W
Woody Splawn
I have a winform with a text field in it. I would like to be able to save
the value in the text field to a XML file so that the next time I open the
Winform I can get the value from the XML file and populate my field. I am
guessing as to exactly what to do but what I have done is as follows:
I created a dataset in my project by right clicking on the project and
selecting add, new dataset. I called it SaveParams01.XSD. There I added an
element, called it CompanyName and called it a string.
I put a button on my form where my intention is to get the value in a
textbox on the form called TextBox1 and then write that value out to and XML
file Called SaveParam.XML. I know how to get the value from the text box
and how to write the dataset to an xml file. The code for doing so I list
below. But I do not know how to do the rest.
Do I need to create a table and somehow associate it with the dataset?
Either to the dataset or to the datatable associated with the dataset I need
to add a row I suppose and assign the value from TextBox1.text to it, but
even after looking at the books I do not know how to write the code to
actually do this.
Could someone help me.
Dim CompanyName As String
CompanyName = TextBox1.Text
???????
DS.WriteXml("SaveParam.xml", XmlWriteMode.WriteSchema)
the value in the text field to a XML file so that the next time I open the
Winform I can get the value from the XML file and populate my field. I am
guessing as to exactly what to do but what I have done is as follows:
I created a dataset in my project by right clicking on the project and
selecting add, new dataset. I called it SaveParams01.XSD. There I added an
element, called it CompanyName and called it a string.
I put a button on my form where my intention is to get the value in a
textbox on the form called TextBox1 and then write that value out to and XML
file Called SaveParam.XML. I know how to get the value from the text box
and how to write the dataset to an xml file. The code for doing so I list
below. But I do not know how to do the rest.
Do I need to create a table and somehow associate it with the dataset?
Either to the dataset or to the datatable associated with the dataset I need
to add a row I suppose and assign the value from TextBox1.text to it, but
even after looking at the books I do not know how to write the code to
actually do this.
Could someone help me.
Dim CompanyName As String
CompanyName = TextBox1.Text
???????
DS.WriteXml("SaveParam.xml", XmlWriteMode.WriteSchema)