Hi
For doing this task create a Emp.xml file like this
<?xml version=”1.0″ encoding=”utf-8″?>
<Emps>
<Emp Id=”1″>
<EmpName>werwer</EmpName>
<EmpSal>345345</EmpSal>
</Emp>
<Emp Id=”2″>
<EmpName>Ram</EmpName>
<EmpSal>45000</EmpSal>
</Emp>
<Emp Id=”3″>
<EmpName>Hari</EmpName>
<EmpSal>35000</EmpSal>
</Emp>
</Emps>
Step2: Write the code in Code behind file like this
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;public partial class GridFillXML : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string filePath = Server.MapPath(“Emp.xml”);
using (DataSet ds = new DataSet())
{
ds.ReadXml(filePath);
GridView1.DataSource = ds;
GridView1.DataBind();
}}
}