1

1

I got an error message that says:

"There is already an open DataReader associated with this Command which must be closed first."

What's the problem?

flag

2 Answers

2

Your connection string needs to have "MultipleActiveResultSets=True" added to it.

To use SQL Server, set your connection string to

Server=server;Initial Catalog=database;MultipleActiveResultSets=true;Integrated Security=SSPI; for Integrated Authentication

or

Server=server;Initial Catalog=database;MultipleActiveResultSets=true;User Id=sqlserveruser;Password=sqlserverpassword;

for SQL Server Authentication

link|flag
0

Michael's answer will solve this problem on SQL Server 2005 and SQL Server 2008. If you're getting this message and you're running SQL Server 2000, make sure this is present in your connection string:

Provider=sqloledb

link|flag

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.