Multiple Active Result Sets (MARS) - ADO.NET

Q.  What is Multiple Active Result Sets (MARS)?

- Published on 27 Jul 15

a. It allows execution of multiple batches against Database on a single connection.
b. New feature of SQL SERVER 2005. Previous version of SQL Server does not support this feature.
c. Option A and B are correct.
d. None of the above.

ANSWER: Option A and B are correct.
 

    Discussion

  • Raj   -Posted on 19 Oct 15
    MARS is a feature that allows the execution of multiple batches on a single connection. It is a new feature supported in sqlserver 2005.
    MARS is disabled by default on the Connection object. You have to enable it with the addition of 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.)