using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace XMLToDataSet
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Btn_ReadXml_Click(object sender, EventArgs e)
        {
            //创建名为DsStudentInfo的DataSet对象
            DataSet DsStudentInfo = new DataSet();
            string XmlPath = Server.MapPath("StudentInfo.xml");
            //StudentInfo.xml数据和架构读入DsStudentInfo对象中
            DsStudentInfo.ReadXml(XmlPath);
            //绑定数据
            this.GridView1.DataSource = DsStudentInfo;
            this.GridView1.DataBind();
        }
    }
}
