Click here to Skip to main content
15,888,271 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
where can i place the data stored in xml? can it be on table? on datagrid view?

i'm not doing web base application.

please suggest a better code for this.

[Moved from Answer]

Can i load xml file into datagridview? if so, how? please help me..
Posted
Updated 11-Nov-10 23:47pm
v2
Comments
Rajesh Anuhya 12-Nov-10 2:00am    
Your Question is not Clear..

Hi,

Try This .... (i think it will help you as per your question)

Step1:
Read the xml file into DataSet like this
DataSet ds = new DataSet();
ds.ReadXML("XML File Path");


**Note: Save Xml Files on FileSystem.
Step2:
Assign DataSet Tables into your DataGridView like this
DataGridView1.DataSource = ds.Tables[0];

Have a look on this also.
http://msdn.microsoft.com/en-us/library/ekw4dh3f(VS.71).asp[^]
 
Share this answer
 
v2
Hi yummy02,
you can place the data from XML file either in Grid or in Table.
Either way, it will work.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900