Possible Duplicate:
SQL: Update a row and returning a column value with 1 query
Get affected rows on ExecuteNonQuery
I have a textbox where the users enter their SQL queries.
On example query could be:
UPDATE customer SET isnew = 1;
Running the above query updates 4 rows, how do I get the '4 rows affected' message that which be returned by SQL Server.
I've tried using InfoMessage
but this only returns messages like 'Changed database context to 'databasenamehere' and not the actual rows affected.