IDataReader and connection open

ilimax

Member
Joined
Sep 2, 2005
Messages
5
Programming Experience
Beginner
In our Windows Forms application we use IDataReader which actually call function from one .dll where we ExecureDataReader()
We have many calls in application and in some places ...
For some reason I am getting error message "DataReader already open" but I am not sure where.
What will happend if I simple close that conection in the that .dll? Am I going to make trouble to database because one datareader left opened?
I assume closing connection will close reader too and gargage collector will manage that left opened datareader..
???
 
For some reason I am getting error message "DataReader already open" but I am not sure where.
You should find out where. It can't be too hard to look at each code block that uses a data reader and work out which one isn't closing it.
 
Next time, use the visual tools to design your data access layer.. it never forgets to close a datareader :)
 
Back
Top