/加载xml并显示在gridview中

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace RegistrationAndQuestionnaireGenerator
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string Path = HttpContext.Current.Server.MapPath("~/xmlData/ConfigContent.xml");
            DataSet objDataSet = new DataSet();
            objDataSet.ReadXml(Path);
            this.gv_SuitList.DataSource = objDataSet.Tables[0];
            this.gv_SuitList.DataBind();
            objDataSet.Dispose();
        }
    }
}


 

你可能感兴趣的:(asp.net)