R
Ryan Jacops
To issue update commands, should I use the Update method
of the DataAdapter or use ExecuteNonQuery method of the
Command object?
Originally I thought the Update method would only update
records in the dataset/datatable. I then learned that you
first had to write an update command and assign it to the
UpdateCommand of the DataAdapter. Further experimentation
led me to find out that UNLESS you explicitly define the
update command WITH THE SAME FILTERS as your select
command that filled the datatable/dataset, the Update
method can potentially update more than just the
datatable/dataset.
That being the case, why not save yourself the extra code
and just simply issue the explicit update command with the
ExecuteNonQuery???? Am I missing something here?
of the DataAdapter or use ExecuteNonQuery method of the
Command object?
Originally I thought the Update method would only update
records in the dataset/datatable. I then learned that you
first had to write an update command and assign it to the
UpdateCommand of the DataAdapter. Further experimentation
led me to find out that UNLESS you explicitly define the
update command WITH THE SAME FILTERS as your select
command that filled the datatable/dataset, the Update
method can potentially update more than just the
datatable/dataset.
That being the case, why not save yourself the extra code
and just simply issue the explicit update command with the
ExecuteNonQuery???? Am I missing something here?