Here's my code, I am using "Data Access Application Block" in ObjectDataSource's class file.
public class Hospital
private Database _db = EnterpriseLibraryContainer.Current.GetInstance<Database>("Conn");
public SqlDataReader sDR;
public SqlDataReader GetHospitals()
RefCountingDataReader dr = (RefCountingDataReader)_db.ExecuteReader("GetHospitals");
in my code, I didnt dispose the dataReader. will it mess up my connection management ? I want to make sure that DbConnection is properly closed.
I found this from "hands on lab".
"You are not doing any connection management here, but it is very important to Dispose the data reader returned. This is accomplished by the using statement in the code above. When the data reader is disposed, the underlying DbConnection is also closed."
please let me know if what I did is ok, i
View Complete Post