Action performed in connection string enable MARS feature - ADO.NET

Q.  MARS feature is disabled by default. What action you will perform in connection string to enable this feature?
- Published on 24 Jul 15

a. Set MultipleActiveResultSets=True"
b. Set MultipleResultSets=true"
c. Set ResultSets=True"
d. None of the above.

ANSWER: Set MultipleActiveResultSets=True"
 

    Discussion

  • Brijesh   -Posted on 21 Oct 15
    You have to set MultipleActiveResultSets=true in your connection string.
    SqlConnection conn = new SqlConnection ( @"Data Source=ServerName;
    Initial Catalog=DataBaseName;Integrated Security=SSPI; MultipleActiveResultSets=true;");

Post your comment / Share knowledge


Enter the code shown above:
 
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)