posae
asked on
Writing Dataset to XML in .Net and then Reading in VB6
Hello,
I have an application written in vb.net using VS 2008. It creates a data set and then writes the data to an xml file using DATASET.DATATABLE.WriteXML ("filename ")
I need to read this xml file in VB6 to load into a datagrid and I am running into some issues. in my VB6 app I simply have the following to open the xml file and check to see if it loads. No Matter what I do, I keep getting an error when loading of "Invalid at the top of the Document"
Private Sub Form_Load()
Dim oDom As New MSXML2.DOMDocument40
Dim bOK As Boolean
CommonDialog1.Filter = "*.xml|*.xml"
CommonDialog1.ShowOpen
If (CommonDialog1.FileName = "") Then Exit Sub
bOK = oDom.loadXML(CommonDialog1 .FileName)
If Not bolResult Then MsgBox oDom.parseError.reason
Exit Sub
End Sub
Here is the XML file contents:
<?xml version="1.0" standalone="yes"?>
<fhsrchResult xmlns="http://tempuri.org/fhsrchResults.xsd">
<fhsrchResult>
<document_name>surveillanc e update</document_name>
<location>001 01 328</location>
<type>CORR</type>
<meta_id>3880</meta_id>
<is_legal>YES</is_legal>
<is_ime>YES</is_ime>
<is_record>YES</is_record>
<status xml:space="preserve">
</status>
<provider />
<filename>001-surveillance update.pdf</filename>
<created_date>2009-02-08T0 6:10:49-05 :00</creat ed_date>
</fhsrchResult>
<fhsrchResult>
<document_name>HRG RPT 10-9-08</document_name>
<location>001 01 328</location>
<type>LEG</type>
<meta_id>3313</meta_id>
<is_legal>YES</is_legal>
<is_ime>NO</is_ime>
<is_record>NO</is_record>
<status xml:space="preserve">
</status>
<provider />
<filename>003-HRG RPT 10-9-08.pdf</filename>
<date_of_service>2008-10-0 9T00:00:00 -04:00</da te_of_serv ice>
<created_date>2009-02-08T0 6:10:45-05 :00</creat ed_date>
</fhsrchResult>
</fhsrchResult>
Any help would be greatly appreciated!
I have an application written in vb.net using VS 2008. It creates a data set and then writes the data to an xml file using DATASET.DATATABLE.WriteXML
I need to read this xml file in VB6 to load into a datagrid and I am running into some issues. in my VB6 app I simply have the following to open the xml file and check to see if it loads. No Matter what I do, I keep getting an error when loading of "Invalid at the top of the Document"
Private Sub Form_Load()
Dim oDom As New MSXML2.DOMDocument40
Dim bOK As Boolean
CommonDialog1.Filter = "*.xml|*.xml"
CommonDialog1.ShowOpen
If (CommonDialog1.FileName = "") Then Exit Sub
bOK = oDom.loadXML(CommonDialog1
If Not bolResult Then MsgBox oDom.parseError.reason
Exit Sub
End Sub
Here is the XML file contents:
<?xml version="1.0" standalone="yes"?>
<fhsrchResult xmlns="http://tempuri.org/fhsrchResults.xsd">
<fhsrchResult>
<document_name>surveillanc
<location>001 01 328</location>
<type>CORR</type>
<meta_id>3880</meta_id>
<is_legal>YES</is_legal>
<is_ime>YES</is_ime>
<is_record>YES</is_record>
<status xml:space="preserve">
</status>
<provider />
<filename>001-surveillance
<created_date>2009-02-08T0
</fhsrchResult>
<fhsrchResult>
<document_name>HRG RPT 10-9-08</document_name>
<location>001 01 328</location>
<type>LEG</type>
<meta_id>3313</meta_id>
<is_legal>YES</is_legal>
<is_ime>NO</is_ime>
<is_record>NO</is_record>
<status xml:space="preserve">
</status>
<provider />
<filename>003-HRG RPT 10-9-08.pdf</filename>
<date_of_service>2008-10-0
<created_date>2009-02-08T0
</fhsrchResult>
</fhsrchResult>
Any help would be greatly appreciated!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Glad to have helped. :-)
ASKER
Ok...now that I have loaded the xml file, is there an easy way to just load the information into a record set?
ASKER
thanks a lot for your help!