SqlConnectionStringBuilder.MultipleActiveResultSets Eigenschap

Definitie

Wanneer waar, kan een toepassing meerdere actieve resultatensets (MARS) onderhouden. Wanneer deze onwaar is, moet een toepassing alle resultatensets van de ene batch verwerken of annuleren voordat deze een andere batch op die verbinding kan uitvoeren.

Zie Meerdere actieve resultatensets (MARS) voor meer informatie.

public:
 property bool MultipleActiveResultSets { bool get(); void set(bool value); };
public bool MultipleActiveResultSets { get; set; }
member this.MultipleActiveResultSets : bool with get, set
Public Property MultipleActiveResultSets As Boolean

Waarde van eigenschap

De waarde van de MultipleActiveResultSets eigenschap of false als er geen is opgegeven.

Voorbeelden

In het volgende voorbeeld wordt de functie Meerdere actieve resultatensets expliciet ingeschakeld.

using System.Data.SqlClient;

class Program
{
    static void Main()
    {
        SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
        builder.DataSource = "(local)";
        builder.IntegratedSecurity = true;
        builder.InitialCatalog = "AdventureWorks";

        // The connection does not allow multiple active result sets
        // by default, so this line of code explicitly
        // enables this feature. Note that this feature is
        // only available when programming against SQL Server 2005
        // or later.
        builder.MultipleActiveResultSets = true;

        Console.WriteLine(builder.ConnectionString);
        Console.WriteLine();

        Console.WriteLine("Press Enter to continue.");
        Console.ReadLine();
    }
}
Imports System.Data.SqlClient
Module Module1
    Sub Main()
        Dim builder As New SqlConnectionStringBuilder
        builder.DataSource = "(local)"
        builder.IntegratedSecurity = True
        builder.InitialCatalog = "AdventureWorks"

        ' The connection does not allow multiple active result sets
        ' by default, so this line of code explicitly
        ' enables this feature. Note that this feature is 
        ' only available when programming against SQL Server 2005
        ' or later.
        builder.MultipleActiveResultSets = True

        Console.WriteLine(builder.ConnectionString)
        Console.WriteLine()

        Console.WriteLine("Press Enter to continue.")
        Console.ReadLine()
    End Sub
End Module

Opmerkingen

Deze eigenschap komt overeen met de sleutel MultipleActiveResultSets in de verbindingsreeks.

Van toepassing op

Zie ook