Converting XML File to Dataset and Binding Dataset To GridViewUsing Asp.Net
02:13Introduction:
Here i will Explain How to convert XML File To Dataset and Binding Dataset To GridView using asp.net
C# Code:
1.Open New Website in VS and Add WebForm To Website.
2.Add Grid View Control to webform and set the id of gridview as grid.
2.Add Grid View Control to webform and set the id of gridview as grid.
3.In .cs file add below name spaces
using System.Data;
using System.Data.SqlClient;
4.Add Below code to page load()
protected void Page_Load(object sender, EventArgs e)
{
DataSet ds = new DataSet();
ds.ReadXml("D:/Book2.xml");
grid.DataSource = abc;
grid.DataBind();
}
5.Run your application(Press F5)
protected void Page_Load(object sender, EventArgs e)
{
DataSet ds = new DataSet();
ds.ReadXml("D:/Book2.xml");
grid.DataSource = abc;
grid.DataBind();
}
5.Run your application(Press F5)
0 comments :