Question how to check if a datatable has a new row added?

adshocker

Well-known member
Joined
Jun 30, 2007
Messages
180
Programming Experience
Beginner
hi all,

how do i determine if my datatable has a new row that hasn't been saved to the database yet? this row can be empty or may contain values. like when you do BindingSource.AddNew.

thanks.
 
Note that BindingSource.AddNew does NOT add a new row to the DataTable. It will create a new row but it doesn't get added until you call EndEdit.

As for the question, call GetChanges on the DataTable and specify Added as the DataRowState. If the result is not Nothing then the table contains at least one new row.
 
Back
Top