Saving a Datagridview to XML (version 2.0)

Jay1b

Well-known member
Joined
Aug 3, 2003
Messages
640
Location
Kent, Uk.
Hi

I have a typed dataset call dsOptions with a table called dtOptions. The form has a datagridview on it with the datasource set to the DtOptionsBindingSource1 and no datamember. When this is assigned the columns are displayed on the datagridview. Ive also tried is as the datasource equal dsOptionsBindingSource1 and the data member set to dtOptions.

I then load the program, type in some data and then press a button which calls the following.

Code:
        Dim myXmlWriter As New System.Xml.XmlTextWriter("hey.xml", System.Text.Encoding.Unicode)

        DsOptions.WriteXml(myXmlWriter)
        DsOptions.WriteXml("hey.txt")
        DsOptions.WriteXml("heynoschema.txt", XmlWriteMode.IgnoreSchema)
        myXmlWriter.Close()

However non of the above options actually output the full XML and data. Instead i just get the following.

<?xml version="1.0" standalone="yes"?>
<dsOptions xmlns="http://tempuri.org/dsOptions.xsd" />

But thats it.

Can someone please tell me what im doing wrong?

Thanks

Jay
 
Well ive found out its the dataset thats not being updated. Which isnt an XML problem so ill post this in the main area.
 
Back
Top