-
DataSet and XML
I wrote this simple example to save info to XML from a dynamically created DataSet. Can anyone tell me if there is a better more efficient way than this?
Thanks...
Code:
private void btnSaveSettings_Click(object sender, System.EventArgs e)
{
string strTest = textBox1.Text ;
// Create an array for the values.
object[] newRow = new object[3];
// Set the values of the array.
newRow[1] = strTest;
newRow[2] = "two";
DataRow myRow;
dsUserSettings.Tables["Settings"].BeginLoadData();
myRow = dsUserSettings.Tables["Settings"].LoadDataRow(newRow,true);
dsUserSettings.Tables["Settings"].EndLoadData();
dsUserSettings.WriteXml("UserSettings.xml");
}
-
Quote:
Originally posted by Shurijo
Have you tried WriteXML method of the dataset?
PHP Code:
'Write out XML data form relational data
myDataSet.WriteXml(m_XmlFile, XmlWriteMode.IgnoreSchema)
no. not yet. thank you