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

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"

Add new comment