tags:

views:

29

answers:

1

Hai,

I have two columns with id,name in the excel sheet.I want to convert into xml file in the below format

Copper Kettle Copper Penny Copperhead Coppertone Copy Boy

suggest me with sample code in ASP.NET.

Thanks

A: 

Why use .NET?
You can use string concatenation in excel itself to achieve the same thing. Your sample does not appear as xml in the question. I have converted Excel to XML many times using cell formulae: e.g.
Excel:
A B
1 Copper_Kettle
2 Copper_Penny
3 Copperhead
4 Coppertone
5 Copy_Boy

then the excel formula you need is:

="<" & B1 & " id="" & A1 & "" />"

Drag this formula down, and you will get what looks like:

<Copper_Kettle id="1">
<Copper_Penny id="2">
<Copperhead id="3">
<Coppertone id="4">
<Copper_Boy id="5">

Remember, you will want a root node for this to be valid XML.
Note: I have replaced the spaces with underscores.

funkymushroom