Select from following answers:- SqlCommand command = new SqlCommand("DeleteExpiredAnnotations ", connection); command.CommandType = CommandType.StoredProcedure; command.Connection.Open(); int count = (int)command.ExecuteScalar();
- SqlCommand command = new SqlCommand("DeleteExpiredAnnotations ", connection); command.CommandType = CommandType.StoredProcedure; command.Connection.Open(); int count = command.ExecuteNonQuery();

- SqlCommand command = new SqlCommand("DeleteExpiredAnnotations ", connection); command.CommandType = CommandType.StoredProcedure; command.Connection.Open(); command.ExecuteNonQuery(); int count = (int)command.Parameters["@ReturnValue"].Value;
- All Above
The ExecuteNonQuery method always returns the number of rows affected.
The rows affected are not returned as a return parameter. Examining a parameter value with the name @ReturnValue throws an exception
Show Correct Answer
Source: MeasureUp.Com | |
Alert Moderator