J
John
Hi,
I use try, catch and finallay to control Sql connection, and run into 1
problem. Some of the sql errors, I don't want the program flow to go to
catch block.
Here is my code snippet:
SqlConnection objSqlConn;
objSqlConn = new SqlConnection(strConnectionString);
try
{
objSqlConn.Open();
//Some SQL statements, if errors go to catch block
//Other SQL statements, if errors DO NOT go to catch block
}
catch(SqlException e)
{
//Do error handling here
}
finally
{
objSqlConn.Close();
}
How do I make it happen?
TIA
I use try, catch and finallay to control Sql connection, and run into 1
problem. Some of the sql errors, I don't want the program flow to go to
catch block.
Here is my code snippet:
SqlConnection objSqlConn;
objSqlConn = new SqlConnection(strConnectionString);
try
{
objSqlConn.Open();
//Some SQL statements, if errors go to catch block
//Other SQL statements, if errors DO NOT go to catch block
}
catch(SqlException e)
{
//Do error handling here
}
finally
{
objSqlConn.Close();
}
How do I make it happen?
TIA