all groups > dotnet ado.net > october 2004 >
You're in the

dotnet ado.net

group:

No of records effected


Re: No of records effected Scott M.
10/30/2004 11:30:10 PM
dotnet ado.net:
ExecuteNonQuery does return the number of records affected already.

Dim recsAffected as Integer
recsAffected = insCmd.ExecuteNonQuery()



[quoted text, click to view]

No of records effected John
10/31/2004 2:55:46 AM
Hi

I am executing a query as below;

Dim insStr As String = "INSERT INTO MyTable1 ( field1, field2, ...) ) " & _
"SELECT MyTable.f1, MyTable.f2, " & _
"FROM MyTable "
Dim insCmd As New OleDbCommand(insStr, Conn)
insCmd.ExecuteNonQuery()

Is there a way to get the number of records actually inserted by this query?

Thanks

Regards

AddThis Social Bookmark Button