W
wl
Hi,
Assume I would like to do the following:
- use an OleDBDataAdapter and OleDBCommandBuilder to "fill" and "update" a
dataset
but: the initial SELECT to fill the dataset with contains only a limited
number of records.
Thus when a record is INSERTED in the disconnected dataset, it would be
possible I need to do an UPDATE
to the database (can't use stored procedures because using Access).
I would think I can use the RowUpdating event of the dataadapter to see
whether an insert or update is needed and adjust the
command accordingly. But this does not work. The "update" method fails.
I tried to to something like this (simplified code):
private void RowUpdating (object sender, OleDbRowUpdatingEventArgs e)
{
e.Command = dap.InsertCommand; //Always do an insert event thought the
operation might have been update
}
Thanks in advance,
Wim
Assume I would like to do the following:
- use an OleDBDataAdapter and OleDBCommandBuilder to "fill" and "update" a
dataset
but: the initial SELECT to fill the dataset with contains only a limited
number of records.
Thus when a record is INSERTED in the disconnected dataset, it would be
possible I need to do an UPDATE
to the database (can't use stored procedures because using Access).
I would think I can use the RowUpdating event of the dataadapter to see
whether an insert or update is needed and adjust the
command accordingly. But this does not work. The "update" method fails.
I tried to to something like this (simplified code):
private void RowUpdating (object sender, OleDbRowUpdatingEventArgs e)
{
e.Command = dap.InsertCommand; //Always do an insert event thought the
operation might have been update
}
Thanks in advance,
Wim