|
-
Jan 4th, 2004, 08:47 PM
#1
Thread Starter
Lively Member
DataReader built into Data Adapter?
I have a button that clears and requeries a DataSet (dsInvoices) based on parameters the user enters into two combo boxes. When I click the button, I get the following infamous error:
There is already an open DataReader associated with this connection which must be closed first.
The odd thing is that since I have this error trapped, after continuing, the program works perfectly. I am aware that a DataReader hogs up a connection and must be explicitly closed. However, the problem is that I have not explicitly created nor opened a DataReader anywhere in the code. I do have some other multi-table DataSets that are open and were populated with a separate Data Adapter for each table in the DataSet.
I have read that when using the .fill method of a Data Adapter, it automatically creates a DataReader with which to populate the DataSet. But since this all happens "behind the scenes," I would expect that the Data Adapter would know to close the DataReader automatically, right? Is there anything else I have to do? Is there any way to manually close a DataReader that was created by a Data Adapter?
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|