You cannot successfully call the datareader outside the using statement, because an open connection is required to read the data.
, , "". ( ). , , , , , , , . , , , , , , ,
: :
SqlDataReader dr = cm.ExecuteReader();
while (dr.Read())
{
firstName = (string)dr["GivenName"];
lastName = (string)dr["sn"];;
}
dr.Close();
, , dr.Close();, , (, ).
Data Reader