Steve Han
Steve Han

Reputation: 11

xml to datatable

can i load data from xml to data table?i don't want to use loop anymore. now i develop in c#.net 2008.my xml format may be like below.

<ItemCode>001</ItemCode>
<ItemName>Item001</ItemName>
<Qty>50</Qty>
<Price>100</Price>
<Amt>5000</Amt>
<ItemCode>002</ItemCode>
<ItemName>Item002</ItemName>
<Qty>70</Qty>
<Price>100</Price>
<Amt>7000</Amt> 
<ItemCode>003</ItemCode>
<ItemName>Item003</ItemName>
<Qty>90</Qty>
<Price>100</Price>
<Amt>9000</Amt>

Regards Han

Upvotes: 1

Views: 309

Answers (1)

James Walford
James Walford

Reputation: 2953

Yes. You should look at DataTable.ReadXML

http://msdn.microsoft.com/en-us/library/yfxbc3by%28v=VS.90%29.aspx

Upvotes: 3

Related Questions