In this example, I'm using a connection object named 'master'.
string strSelectA = "SELECT * FROM REF_CSDTransiti on";
OleDbDataAdapte r refAdapter = new OleDbDataAdapte r(strSelectA, master);
OleDbCommandBui lder refCommand = new OleDbCommandBui lder(refAdapter );
// The OleDbCommandBui lder will automatically generate the Insert command
for the Update method...
try
{
refAdapter.Fill (ds1, "ref");
}
finally
{
master.Close();
}
// Change your dataset table "ref" here!
try
{
master.Open();
refAdapter.Upda te(ds1, "ref");
}
finally
{
master.Close();
ds1.Tables["ref"].Dispose();
}
Disposing the "ref" dataset table is not necessary, but I did in this
instance since I am no longer using it at this point.
Good Luck
- carl
"PawelR" <Pa************ @poczta.onet.pl > wrote in message
news:bi******** **@nemesis.news .tpi.pl...
Hi Nicholas,
I use oleDbDataAdapte r1.Update(fromA ccesDS) and
oleDbDataAdapte r1.Update(fromA ccesDS.MyTable) and
oleDbDataAdapte r1.Update(fromA ccesDS.Tables["MyTable"])
and file db1.mdb is not changes.
Meybe I don't understend You. My English is very poor. Please write me
example lines.
Thx
Pawel
Nicholas Paldino [.NET/C# MVP] napisa³:
Pawel,
If you still have the DataAdapter which you used to get the data,
then you can set the Update, Delete and Insert command properties to commands
that should be executed to update the rows in the table. You then call
Update, passing the dataset with the modified data to the method.
Hope this helps.