SqlConnectionStringBuilder.MultipleActiveResultSets Propriedade

Definição

Quando for verdadeiro, um aplicativo poderá manter MARS (conjuntos de resultados ativos múltiplos).When true, an application can maintain multiple active result sets (MARS). Quando for falso, um aplicativo deverá processar ou cancelar todos os conjuntos de resultados de um lote antes de poder executar outro lote nessa conexão.When false, an application must process or cancel all result sets from one batch before it can execute any other batch on that connection.

Para obter mais informações, confira MARS (Conjunto de Resultados Ativos Múltiplos).For more information, see Multiple Active Result Sets (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

Valor da propriedade

O valor da propriedade MultipleActiveResultSets ou false se nenhum tiver sido aplicado.The value of the MultipleActiveResultSets property, or false if none has been supplied.

Exemplos

O exemplo a seguir desabilita explicitamente o recurso de vários conjuntos de resultados ativos.The following example explicitly disables the Multiple Active Result Sets feature.

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

Comentários

Essa propriedade corresponde à chave "MultipleActiveResultSets" na cadeia de conexão.This property corresponds to the "MultipleActiveResultSets" key within the connection string.

Aplica-se a

Veja também