R
Roy
What is the correct sequence for 'using' statement and 'try -- catch'? Which
of the following is right?
try
{
using (SqlConnection connection = new SqlConnection(connectionString))
{
send some queries to db
}
}
catch (Exeption e)
{
handle exception
}
Or
using (SqlConnection connection = new SqlConnection(connectionString))
{
try
{
send some queries to db
}
catch (Exeption e)
{
handle exception
}
}
of the following is right?
try
{
using (SqlConnection connection = new SqlConnection(connectionString))
{
send some queries to db
}
}
catch (Exeption e)
{
handle exception
}
Or
using (SqlConnection connection = new SqlConnection(connectionString))
{
try
{
send some queries to db
}
catch (Exeption e)
{
handle exception
}
}