大家好!
我想问一个问题,如何提取XML中指定项的内容啊,如:XML里有10行,我要提取其中的3,4,5,6,7,,8行的数据绑定到DataGrid里请大家帮帮忙啊。十分感谢!

解决方案 »

  1.   

    XmlDocument doc = new XmlDocument();
          doc.Load("booksort.xml");      //Create an XmlNamespaceManager for resolving namespaces.
          XmlNamespaceManager nsmgr = new XmlNamespaceManager(doc.NameTable);
          nsmgr.AddNamespace("bk", "urn:samples");      //Select and display the value of all the ISBN attributes.
          XmlNodeList nodeList;
          XmlElement root = doc.DocumentElement;
          nodeList = root.SelectNodes("/bookstore/book/@bk:ISBN", nsmgr);
          foreach (XmlNode isbn in nodeList){
            Console.WriteLine(isbn.Value);
      

  2.   

    我是在c#里做的,现在必须要与DataGrid 绑定,还有没有其它方法呢
      

  3.   

    新年好! dataset.readxml这个是全部读的啊,我要读部份 !