Click here to Skip to main content
15,898,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
While I am running this code to retrieve data from XML to a dataGridview control it, doesn't retrieve data and shows an error "Can not find table 0"
code is as :-
C#
private void button1_Click(object sender, EventArgs e)
        {
            DataSet ds = new DataSet();
            ds.ReadXml(@"E:\Sales_Details.xml");
            dataGridView1.DataSource = ds.Tables[0];
        }

what is the reason behind it I can't find. Please help.

[Edit]Code block formatting added[/Edit]
Posted
Updated 25-Jun-13 5:51am
v7
Comments
Mahesh Bailwal 22-Jun-13 14:00pm    
Can you share your XML?
Sharath2790 24-Jun-13 6:44am    
May be xml creation is not proper.....

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