changedim newdataset as dataset()
===>
dim newdataset as new dataset

解决方案 »

  1.   

    思归,怎摸还是不行,newdataset.readxml(server.mappath("xml.xml"))这一行应该没错吧
      

  2.   

    what error did you get this time? is "xml.xml" in the same directory and has well-formed format?
      

  3.   

    有未闭合的字符串。 行 15,位置 14。 异常详细信息: System.Xml.XmlException: 有未闭合的字符串。 行 15,位置 14
    源错误: 
    行 9:  newdataset.readxml(server.mappath("xml.xml"))
      

  4.   

    <?xml version="1.0" standalone="yes'?>
    <newdataset>
    <books>
    <bookname>beginning asp</bookname>
    <isbn>186005040</isbn>
    </books>
    <books>
    <bookname>professional asp</bookname>
    <isbn>186004885</isbn>
    </books>
    <books>
    <bookname>beginning vb</bookname>
    <isbn>186004966</isbn>
    </books>
    </newdataset>
    IS IT invalid?
      

  5.   

    yes, the file is valid, and the following works on my machine:Imports System
    Imports System.Dataclass TestXml2
      shared sub main()
    dim newdataset as new dataset
    newdataset.ReadXml("TestData.Xml")
    dim dt as DataTable
    for each dt in newdataset.Tables
    Console.WriteLine("{0} has {1} rows", dt.TableName, dt.Rows.Count)
    next
      end sub
    end class