M
Maury
Hi,
I would like to persist a Dataset Table
in an Access Table
I have a Access Database and I saved
the data in a XML file:
string strSQL = "SELECT * FROM "+TableName;
OleDbDataAdapter myDataAdapter = new OleDbDataAdapter(strSQL, myConnection);
DataSet myDataSet = new DataSet();
myDataAdapter.Fill(myDataSet, TableName);
myConnection.Close();
myDataSet.WriteXml(@"C:\Inetpub\wwwroot\xxx\Write\"+TableName+".xml");
Then I delete all rows from the Access table and I read the Xml:
DataSet myDataSet = new DataSet();
myDataSet.ReadXml(@"C:\Inetpub\wwwroot\xxx\Write\"+TableName+".xml");
but now I would like to save back the data (in myDataSet) into the table.
By now I do this "row by row" but I don't like this
Is there some better solution?
Thanks
M.A.
I would like to persist a Dataset Table
in an Access Table
I have a Access Database and I saved
the data in a XML file:
string strSQL = "SELECT * FROM "+TableName;
OleDbDataAdapter myDataAdapter = new OleDbDataAdapter(strSQL, myConnection);
DataSet myDataSet = new DataSet();
myDataAdapter.Fill(myDataSet, TableName);
myConnection.Close();
myDataSet.WriteXml(@"C:\Inetpub\wwwroot\xxx\Write\"+TableName+".xml");
Then I delete all rows from the Access table and I read the Xml:
DataSet myDataSet = new DataSet();
myDataSet.ReadXml(@"C:\Inetpub\wwwroot\xxx\Write\"+TableName+".xml");
but now I would like to save back the data (in myDataSet) into the table.
By now I do this "row by row" but I don't like this
Is there some better solution?
Thanks
M.A.