- using System;
- using System.Data;
- using System.Configuration;
- 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;
- using System.IO;
- public partial class _Default : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- FileStream fileStream = new FileStream(Server.MapPath("student.xml"), FileMode.Open, FileAccess.Read);
- StreamReader streamReader = new StreamReader(fileStream);
- DataSet dataSet = new DataSet();
- dataSet.ReadXml(streamReader);
- this.DataGrid1.DataSource = dataSet.Tables[0];
- this.DataGrid1.DataBind();
- }
- }
从XML文件中读取数据
最新推荐文章于 2021-04-26 10:12:24 发布