Do I have to call DataSet.AcceptChanges() and commit

  • Thread starter Thread starter Dan V.
  • Start date Start date
D

Dan V.

Do I have to call AcceptChanges() every time I append my data row in the
procedure below: FillDataRow OR can I just call commit everytime? thanks.


Simplified code below:
// ------------------------------------------------

myTrans =
vDataAdapter.InsertCommand.Connection.BeginTransaction(IsolationLevel.ReadCo
mmitted);
vDataAdapter.InsertCommand.Transaction = myTrans;

FillDataRow( blah blah blah ) ;

myTrans.Commit();

....



// -------------------------------------------------------

public Boolean FillDataRow(blah blah blah );

{

DataRow workrow;



workrow = tbl.NewRow();

workrow["blah1"] = blah1;

workrow["blah2"] = blah2;

tbl.Rows.Add(workrow);

bDataAdapter.Update(vDataSet, tbl.TableName); // run SQL: insert statement

}
 
Dan,

The DataAdapter has its inbuild acceptchanges for all rows that are
processed correct.

Cor
 
Back
Top