G
Guest
Hi,
I am working on program to cop data from the main database (Oracle or SQL
Server) to a local Access-database used on laptops. The databse is quite
large so the routine nedds to be fast.
The stripped down code looks like this:
OleDbCommand cmd = new OleDbCommand("SELECT * FROM Table",
connServer);
OleDbDataAdapter daServer = new OleDbDataAdapter(cmd);
DataSet dsServer = new DataSet();
daServer.Fill(dsServer);
DataSet dsLocal = dsServer.Copy();
// So far everything is OK
OleDbCommand cmd2 = new OleDbCommand("UPDATE Table SET CopyDate
= '" + DateTime.Now + "'", connLocal);
OleDbDataAdapter daLocal = new OleDbDataAdapter(cmd2);
daLocal.Update(dsLocal);
cmd2.ExecuteNonQuery();
Nothing happens in the Access database. dsLocal.HasChanges() is False when I
check. Why? What am I missing?
I am working on program to cop data from the main database (Oracle or SQL
Server) to a local Access-database used on laptops. The databse is quite
large so the routine nedds to be fast.
The stripped down code looks like this:
OleDbCommand cmd = new OleDbCommand("SELECT * FROM Table",
connServer);
OleDbDataAdapter daServer = new OleDbDataAdapter(cmd);
DataSet dsServer = new DataSet();
daServer.Fill(dsServer);
DataSet dsLocal = dsServer.Copy();
// So far everything is OK
OleDbCommand cmd2 = new OleDbCommand("UPDATE Table SET CopyDate
= '" + DateTime.Now + "'", connLocal);
OleDbDataAdapter daLocal = new OleDbDataAdapter(cmd2);
daLocal.Update(dsLocal);
cmd2.ExecuteNonQuery();
Nothing happens in the Access database. dsLocal.HasChanges() is False when I
check. Why? What am I missing?