Konrad said:
Hi
How or where can I see full used commands generated
via CommandBuilder for DataAdapter.
Using DataAdapter not CommandBuilder?
If the DataAdapter needs a command that it doesn't have, it will invoke the
CommandBuilder to create one.
If you need to see the command ( and perhaps modify it ) before the
DataAdapter uses it, you can invoke the CommandBuilder yourself.
Just use CommandBuilder.GetXXXCommand, optionally edit the command, and pass
the command to the DataAdapter.
eg
dim cb as new SqlCommandBuilder(da)
.. ..
Dim cmd As SqlCommand = cb.GetInsertCommand
cmd.CommandText = cmd.CommandText & "; set @newid = SCOPE_IDENTITY()"
Dim pNewID As SqlParameter = New SqlParameter("@newid", SqlDbType.Int)
pNewID.Direction = ParameterDirection.Output
pNewID.SourceColumn = "ID"
to return the new ID column into the dataset.