difference between insert query and dataadapter.update


  • Hi all Is there any difference in the 1) If I insert a row into a sql table using insert query  and 2) If I fill a datatable in dataset and add a row to it and again use the dataadapter.Update method for inserting this row..



    Thursday, March 03, 2011 10:46 AM


  • With an insert you only handle the insert of a row


    In a datatable a dataadapter update does (in short):

    Checks which rows are changed;

    Checks if the connection is open and if not opens it;

    Updates the rows which are changed by insert, delete or update;

    Checks for error during that and set the errorstates;

    Set all the rowstates to unchanged in the datatable and removes the deleted rows (does automatically an updatechanges);

    if the connection was opened by the dataadapter closes it again.

    There are some more around the key when it is an autoidentifier but I think I have above the most general ones.


    • Marked as answer by bahushekh Tuesday, March 08, 2011 12:51 PM
    Friday, March 04, 2011 8:04 AM