Readxml diffgram: returns empty dataset

M

Mav

Hello,

I'm trying to fill a dataset with the data of a diffgram xml-file.

I expect a dataset with datasetname "ComputerSystem" filled with 1
table (tables.count = 1). The only thing i've got is an empty dataset
(datasetname = "NewDataSet", tables.count=0). You find a code snippet
in attach. Any ideas?

Thanks,

Mav.

Dim XMLSource As String
Dim datasetHandler As DataSet
Dim srDataSet As StringReader

XMLSource = XMLSource & "<diffgr:diffgram
xmlns:msdata='urn:schemas-microsoft-com:xml-msdata'
xmlns:diffgr='urn:schemas-microsoft-com:xml-diffgram-v1'>"
XMLSource = XMLSource & "<ComputerSystem>"
XMLSource = XMLSource & "<Win32_ComputerSystem
diffgr:id='Win32_ComputerSystem1' msdata:rowOrder='0'>"
XMLSource = XMLSource & "<GUID />"
XMLSource = XMLSource & "<CMEnvironment>AGENT</CMEnvironment>"
XMLSource = XMLSource & "<OEMLogoBitmap />"
XMLSource = XMLSource & "<OEMStringArray />"
XMLSource = XMLSource & "</Win32_ComputerSystem>"
XMLSource = XMLSource & "</ComputerSystem>"
XMLSource = XMLSource & "</diffgr:diffgram>"


Try
datasetHandler = New DataSet
srDataSet = New StringReader(XMLSource)
datasetHandler.ReadXml(srDataSet, XmlReadMode.DiffGram)
Catch gex As Exception
Debug.Write(gex.Message)
End Try
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top