.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ADO.Net >> Post New QuestionBookmark and Share Subscribe to Forum

how to read the xml values into data table.

Posted By: sridar1     Posted Date: March 21, 2011    Points:5   Category :ADO.Net
Hai

I want to read the xml values into datatable.How can I do this.

for eg:
datatable dt=new datatable();
datacolumn dc =new datacolumn("ID",typeof(int32));
dt.columns.add(dc);
datarow dr=dt.new datarow();
dr[1]="1";
dt.rows.add(dr);


The above code is for adding columns and rowws into datatable.
But plz tell me how to get all the values from xml and put it into datatable.

Responses
Author: Sunil Yadav       [Moderator]      
Posted Date: March 21, 2011     Points: 20   
Author: SureshM             
Posted Date: June 08, 2011     Points: 20   

Hi,

The below code enough

datatable dt=new datatable();

dt.ReadXml(myXMLfile file path);





Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend