Possible Duplicate:
What is the C# Using block and why should I use it?
Whats the significance of using block
? Why should i write my code inside using block?
eg:
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["newConnectionString"].ConnectionString);
using (con)
{
con.Open();
//
// Some code
//
con.Close();
}
Is this the right way of using using statement
?