SqlConnectionStringBuilder.MultipleActiveResultSets Vlastnost

Definice

Pokud je pravda, může aplikace udržovat více aktivních sad výsledků (MARS). Pokud je hodnota false, musí aplikace zpracovat nebo zrušit všechny sady výsledků z jedné dávky, aby bylo možné na daném připojení spustit jakoukoli jinou dávku.

Další informace naleznete v tématu Více aktivních sad výsledků (MARS).

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

Hodnota vlastnosti

Hodnota MultipleActiveResultSets vlastnosti nebo false pokud nebyla zadána žádná.

Příklady

Následující příklad explicitně povolí funkci Více aktivních sad výsledků.

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

Poznámky

Tato vlastnost odpovídá klíč MultipleActiveResultSets v rámci připojovací řetězec.

Platí pro

Viz také