Determine rows affected by Update command
Posted: Fri 02 May 2008 00:43
I use this snippet to update row(s) in the database, but need to know the number of rows affected. What is the easiest way to get the number of rows affected? Thanks!
Code: Select all
string myInsertCommand = "UPDATE callees " +
"SET result = '" + result + "' " +
"WHERE (customer.id = " + id + ") AND (status 'BUSY')";
PgSqlCommand insertData = new PgSqlCommand(myInsertCommand, pgSqlConnection1);
pgSqlConnection1.Open();
insertData.ExecuteNonQuery();