I want to use the "using" block in my DAL layer. Like
using (SqlConnection con = new SqlConnection("connection string"))
{
Command object
Reader object
}
Since the SqlConnection object in initialised in the using block i know that this connection object will be automatically disposed when the control exits the using block scope.
But i am creating Command and Reader objects inside the using block. Do i have to explicitly close them or do i have to write another "using" block for them.
using (...)parentheses are actually disposed. Here, the Command and Reader will not be disposed.