0
我有這樣的XML內容:加載使用asp.net返回XML文件中沒有記錄
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Option1>false</Option1>
<Option2>http://www.google.com</Option2>
<Option3>false</Option3>
<Option4>false</Option4>
</configuration>
我嘗試使用代碼波紋管閱讀本XML,但Dataset.tables.count始終返回0
Dim dtConfig As New DataSet
Dim sArqXml as String = "asd.xml"
Dim xmlRoot As New XmlRootAttribute
xmlRoot.ElementName = "configuration"
xmlRoot.IsNullable = True
Dim xmlSer As XmlSerializer = New XmlSerializer(dtConfig.GetType, xmlRoot)
Dim fs As FileStream = New FileStream(sArqXml, FileMode.Open)
dtConfig = CType(xmlSer.Deserialize(fs), DataSet)
fs.Close()
我該如何閱讀這個XML?解決方案可以在C#中。
是什麼讓你認爲你可以讀取數據到一個DataSet?它是否來自DataSet? –