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 :-
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]