Monday, November 07, 2005

VS2005 SQL Server 2005 RC/RTM Gotcha with MARS

For those who are familiar with MARS (Multiple Active Result Sets) and have been excitedly using them with versions of visual studio 2005 prior to the the june CTP, you may be interested to know that there has been a change in the default behaviour.

MARS is OFF by default, and any code written to use it as in this code project article will cause an exception if you don't explicitly add the following to your connection string "MultipleActiveResultSets=true".

The exception you will receive is "There is already an open DataReader associated with this Connection which must be closed first".

Another resource of interest is "Getting the MARS Sample working in the june CTP".

No comments:

Post a Comment