SessionStateSection.SqlConnectionString Właściwość

Definicja

Pobiera lub ustawia parametry połączenia SQL.

public:
 property System::String ^ SqlConnectionString { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("sqlConnectionString", DefaultValue="data source=localhost;Integrated Security=SSPI")]
public string SqlConnectionString { get; set; }
[<System.Configuration.ConfigurationProperty("sqlConnectionString", DefaultValue="data source=localhost;Integrated Security=SSPI")>]
member this.SqlConnectionString : string with get, set
Public Property SqlConnectionString As String

Wartość właściwości

Parametry połączenia SQL. Jego wartością domyślną jest ciąg ogólny: "data source=127.0.0.1;Integrated Security=SSPI"

Atrybuty

Przykłady

W poniższym przykładzie kodu pokazano, jak uzyskać SqlConnectionString właściwość . Zapoznaj się z przykładem kodu w temacie SessionStateSection klasy, aby dowiedzieć się, jak uzyskać dostęp SessionStateSection do obiektu.

// Display the current SqlConnectionString property value.
Console.WriteLine("SqlConnectionString: {0}",
  sessionStateSection.SqlConnectionString);
' Display the current SqlConnectionString property value.
Console.WriteLine("SqlConnectionString: {0}", _
  sessionStateSection.SqlConnectionString)

Uwagi

Ten sqlConnectionString atrybut jest wymagany, gdy Mode jest ustawiony na SQLServerwartość .

Uwaga

Aby użyć SQLServer trybu stanu sesji, należy uruchomić skrypt InstallSqlState.sql SQL (który jest zainstalowany w [drive:]\WINDOWS\Microsoft.NET\Framework\VersionNumber w ramach instalacji domyślnej .NET Framework) na komputerze z systemem SQL Server, który będzie przechowywać stan sesji. Spowoduje to utworzenie bazy danych o nazwie ASPState z nowymi procedurami składowanymi i utworzenie nowych tabel ASPStateTempApplications i ASPStateTempSessions w bazie danych TempDB.

Dotyczy