I want to use the "using" block in my DAL layer. how
using (SqlConnection con = new SqlConnection("connection string"))
{
Command object
Reader object
}
Since the SqlConnection object initialized in the use block, I know that this connection object will be automatically deleted when the control leaves the scope of the block.
But I am creating Command and Reader objects inside the use block. Should I explicitly close them or do I need to write another “used” block for them.
source
share