• We just launched and are currently in beta. Join us as we build and grow the community.

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

455

Neko Fanatic
4 Rep
0
0
0
Rep
0
4 Vouches
0
0
0
Vouches
0
Posts
81
Likes
67
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1 300 XP
This error occur if you forgot to include “MultipleActiveResultSets=True” in your connection string. It was actually on by default in VS 2005 but was later set to off.

Here’s an example of a connection string w/ MARs set.

SQL Server authentication:

cnString =

"Data Source="

&

ServerName &

";Initial Catalog="

&

DatabaseName &

";Persist Security Info=True;MultipleActiveResultSets=True;User ID=sa;Password=12345678"

Windows Authentication Mode:

cnString =

"Data Source="

&

ServerName &

";Initial Catalog="

&

DatabaseName &

";Integrated Security=True;MultipleActiveResultSets=True"

 

452,496

330,760

330,768

Top