DataSet ds = new DataSet()
ds.LoadXML(路径);DropDownList1.DataSource = ds.tables[0];这样应该差不多了

解决方案 »

  1.   

    string xmlPath = Server.MapPath("../Config/Sort.xml");
    XmlDocument xmlDoc = new XmlDocument();
    if(System.IO.File.Exists(xmlPath))
    {
    xmlDoc.Load(xmlPath);
    XmlNode Root = xmlDoc.DocumentElement;
    XmlNode Node = Root.SelectSingleNode("//学生信息");
    if(Node != null && Node.HasChildNodes)
    {
    foreach(XmlNode subNode in Node.ChildNodes)
    {
    dplSort.Items.Add(new ListItem(subNode.Attributes["Name"].Value, subNode.Attributes["ID"].Value));
    }
    dplSort.Items.Insert(0,""); 
    }
    }
      

  2.   

    ds.LoadXML   -> ds.ReadXml(路径);
      

  3.   

    Document doc = new Document();
    doc.LoadXML(XML文件路径);XMLNodeList xnl = doc.selectsigleNod("学生信息").childNodes;
    foreach( XmlNode xm in xnl)
    {
      XmlElement xe = (XmlElement) xm;
      string strText = xe.GetElementByTagName("学生");
      
      ListItem item = new ListItem();
      item.Text = strText;
      DropDownList.iTems.add( item)  
    }