Question DbDataAdapter.Update Method

Naren

New member
Joined
Jan 7, 2010
Messages
3
Programming Experience
Beginner
Dear Friends,

Good Wishes.

I am using VB .net Windows Application (Frame work 1.1) and the database is SQL Server 2000.

I use the method 'DbDataAdapter.Update Method'. As per the help/tool tip given in the vb, the method:

Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the DataSet.

Is it possible by using any method, to find out specifically, whether it is calling the 'INSERT' Statement or 'UPDATE' Statement or 'DELETE' Statement?

Thanks in advance.
Naren.
 
With the RowUpdated event of the provider adapter (f.ex SqlDataAdapter) you can see from event parameter (e As RowUpdatedEventArgs) which StatementType was executed.
The help explanation for that method says is calls OnRowUpdated, which "Raises the RowUpdated event of a .NET Framework data provider."
 
Hi John,

Thanks for the reply. I am new to the VB .Net environment (new to Microsoft itself). Can you please explain me more specifically?

With regards,
Naren.
 
The adapter will scan all rows in the provided datatable, and consider the RowState property of each row

If the RowState is...
...Added then the INSERT sql will be called
...Modified then the UPDATE sql will be called
...Deleted then the DELETE sql will be called
 
Back
Top