SqlServices.InstallSessionState Metoda

Definicja

Instaluje składniki stanu sesji ASP.NET w bazie danych SQL Server.

Przeciążenia

InstallSessionState(String, String, SessionStateType)

Instaluje składniki stanu sesji ASP.NET w bazie danych SQL Server.

InstallSessionState(String, SessionStateType, String)

Instaluje składniki stanu sesji ASP.NET w bazie danych SQL Server.

InstallSessionState(String, String, String, String, SessionStateType)

Instaluje składniki stanu sesji ASP.NET w bazie danych SQL Server.

InstallSessionState(String, String, SessionStateType)

Instaluje składniki stanu sesji ASP.NET w bazie danych SQL Server.

public:
 static void InstallSessionState(System::String ^ server, System::String ^ customDatabase, System::Web::Management::SessionStateType type);
public static void InstallSessionState (string server, string customDatabase, System.Web.Management.SessionStateType type);
static member InstallSessionState : string * string * System.Web.Management.SessionStateType -> unit
Public Shared Sub InstallSessionState (server As String, customDatabase As String, type As SessionStateType)

Parametry

server
String

Wystąpienie SQL Server, na którym należy zainstalować składniki stanu sesji.

customDatabase
String

Baza danych, na której mają być instalowane składniki stanu sesji.

type
SessionStateType

SessionStateType Jedną z wartości określających typ stanu sesji do zainstalowania.

Wyjątki

Typ to Custom i customDatabase wartość nie jest podana lub typ jest Temporary albo Persisted , a customDatabase wartość nie ma wartości null.

Nie można nawiązać połączenia z określonym serwerem bazy danych.

Wystąpił wyjątek podczas przetwarzania instrukcji SQL wymaganych do wykonania operacji.

Przykłady

W poniższym przykładzie kodu pokazano, jak używać InstallSessionState metody SqlServices klasy .

// Install temporary session state.
SqlServices.InstallSessionState(server, null,
    SessionStateType.Temporary);
' Install temporary session state.
SqlServices.InstallSessionState(server, Nothing, _
    SessionStateType.Temporary)

Uwagi

Jeśli server parametr jest null podany lub nie zostanie podany, SqlServices użyje domyślnego wystąpienia SQL Server.

Uwaga

Połączenie z serwerem bazy danych jest nawiązywane z zaufanym połączeniem.

Zobacz też

Dotyczy

InstallSessionState(String, SessionStateType, String)

Instaluje składniki stanu sesji ASP.NET w bazie danych SQL Server.

public:
 static void InstallSessionState(System::String ^ customDatabase, System::Web::Management::SessionStateType type, System::String ^ connectionString);
public static void InstallSessionState (string customDatabase, System.Web.Management.SessionStateType type, string connectionString);
static member InstallSessionState : string * System.Web.Management.SessionStateType * string -> unit
Public Shared Sub InstallSessionState (customDatabase As String, type As SessionStateType, connectionString As String)

Parametry

customDatabase
String

Baza danych, na której mają być instalowane składniki stanu sesji.

type
SessionStateType

SessionStateType Jedną z wartości określających typ stanu sesji do zainstalowania.

connectionString
String

Parametry połączenia do użycia. Parametry połączenia są używane tylko do nawiązywania połączenia z serwerem bazy danych. Określenie bazy danych w parametrach połączenia nie ma wpływu.

Wyjątki

Typ to Custom i customDatabase wartość nie jest podana lub typ jest Temporary albo Persisted , a customDatabase wartość nie ma wartości null.

Nie można nawiązać połączenia z określonym serwerem bazy danych.

Wystąpił wyjątek podczas przetwarzania instrukcji SQL wymaganych do wykonania operacji.

Przykłady

W poniższym przykładzie kodu pokazano, jak używać InstallSessionState(String, SessionStateType, String) metody SqlServices klasy .

// Install a custom session state database.
SqlServices.InstallSessionState(database,
    SessionStateType.Custom,
    connectionString);
' Install a custom session state database.
SqlServices.InstallSessionState(database, _
    SessionStateType.Custom, _
    connectionString)

Zobacz też

Dotyczy

InstallSessionState(String, String, String, String, SessionStateType)

Instaluje składniki stanu sesji ASP.NET w bazie danych SQL Server.

public:
 static void InstallSessionState(System::String ^ server, System::String ^ user, System::String ^ password, System::String ^ customDatabase, System::Web::Management::SessionStateType type);
public static void InstallSessionState (string server, string user, string password, string customDatabase, System.Web.Management.SessionStateType type);
static member InstallSessionState : string * string * string * string * System.Web.Management.SessionStateType -> unit
Public Shared Sub InstallSessionState (server As String, user As String, password As String, customDatabase As String, type As SessionStateType)

Parametry

server
String

Wystąpienie SQL Server, na którym należy zainstalować składniki stanu sesji.

user
String

Nazwa użytkownika używana podczas nawiązywania połączenia z bazą danych.

password
String

Hasło do użycia podczas nawiązywania połączenia z bazą danych.

customDatabase
String

Baza danych, na której mają być instalowane składniki stanu sesji.

type
SessionStateType

SessionStateType Jedną z wartości określających typ stanu sesji do zainstalowania.

Wyjątki

Typ to Custom i customDatabase wartość nie jest podana lub typ jest Temporary albo Persisted , a customDatabase wartość nie ma wartości null.

Nie można nawiązać połączenia z określonym serwerem bazy danych.

Wystąpił wyjątek podczas przetwarzania instrukcji SQL wymaganych do wykonania operacji.

Przykłady

W poniższym przykładzie kodu pokazano, jak używać InstallSessionState(String, String, String, String, SessionStateType) metody SqlServices klasy .

// Install persisted session state.
SqlServices.InstallSessionState(server, user, password,
    null, SessionStateType.Persisted);
' Install persisted session state.
SqlServices.InstallSessionState(server, user, password, _
    Nothing, SessionStateType.Persisted)

Uwagi

Jeśli server parametr jest null podany lub nie zostanie podany, SqlServices użyje domyślnego wystąpienia SQL Server.

Uwaga

Połączenie z serwerem bazy danych jest nawiązywane z zaufanym połączeniem.

Zobacz też

Dotyczy