R
Ruslan
Hi,
I have the following code:
using (SqlConnection connection = DBConnector.GetConnection())
{
SqlCommand cm = new SqlCommand();
SqlDataReader dr = new SqlDataReader (cm.ExecuteReader());
while (dr.Read())
{
...
}
}
There is no dr.Close() because the "connection" is closed when it is out of
"using". How it important to add dr.Close()?
Thanks,
Ruslan
I have the following code:
using (SqlConnection connection = DBConnector.GetConnection())
{
SqlCommand cm = new SqlCommand();
SqlDataReader dr = new SqlDataReader (cm.ExecuteReader());
while (dr.Read())
{
...
}
}
There is no dr.Close() because the "connection" is closed when it is out of
"using". How it important to add dr.Close()?
Thanks,
Ruslan