Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

More than one open DataReader against a Connection ?

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
GB
I have an active / open SqlConnection against a SQL Server database.

When I try to open a second DataReader using this connection I get the message "There is already an open DataReader associated with this Connection which must be closed first".

Am I restricted to 1 active DataReader against a connection ? Do I need seperate SqlConnections for each DataReader I might potentially need in the scope of my application ?

Thanks for any pointers / advice in advance

Steve
 
Steve

ADO.NET is designed to worked with in a disconnected mannor so personally i would suggest using a dataset, datasets can hold multiple resultsets.

If you used to ADO then you'll remember you can't open two recordsets with the same connection.

CHeers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top