0

The following puts content of an excel file (one worksheet; one column) into a DataSet that needs to be an excel string:

enter image description here

        DataSet ds = excelReader.AsDataSet();

        StringWriter sw = new StringWriter();
        ds.WriteXml(sw);
        string result = sw.ToString(); 

it returns the following string:

<NewDataSet>
<Sheet2><Column1>70209429072734</Column1></Sheet2>
<Sheet2><Column1>30221442748624</Column1></Sheet2>
<Sheet2><Column1>70209433124464</Column1></Sheet2>
<Sheet2><Column1>30209434466634</Column1></Sheet2>
</NewDataSet>

I want it in this format:

<DLN>
   <id>70209429072734</id>
   <id>30221442748624</id>
   <id>70209433124464</id>
   <id>30209434466634</id>
</DLN>
Chaka
  • 1,709
  • 11
  • 33
  • 58

0 Answers0