I have created a custom windows service in c#.
I am using a try catch around a call to a Sql Server Stored Procedure.
ie:
try
{
int rowsaffected = cmd.ExecuteNonQuery();
}
I want to catch the SqlException and trap for error -2 (command timeout) AND I want to trap for ALL other Exceptions. I want to do some special processing with the SqlException. The issue I am having is that my google returns show confusing syntax. Is it
try
{}
catch(SqlException sql_except)
{}
catch(Exception all_except)
{}
or something else?
Thanks.