SessionStateType 枚举

定义

描述在安装会话状态数据库提供程序时所使用的会话状态类型。Describes the session-state type used when installing a session-state database provider.

public enum class SessionStateType
public enum SessionStateType
type SessionStateType = 
Public Enum SessionStateType
继承
SessionStateType

字段

Custom 2

会话状态数据和存储过程放在自定义的数据存储区中。Session-state data and stored procedures are placed in a custom data store.

Persisted 1

会话状态数据和存储过程放在“ASPState”数据库中。Session-state data and stored procedures are placed in the "ASPState" database. 在数据库服务器重新启动后,会话状态数据不会丢失。Session-state data will survive a restart of the database server.

Temporary 0

会话状态数据存储在 tempdb 中,存储过程放在“ASPState”数据库中。Session state data is stored in tempdb, and stored procedures are placed in the "ASPState" database. 在 SQL Server 重新启动后,会话状态数据将会丢失。Session state data will not survive a restart of SQL Server.

示例

下面的代码示例演示如何将SessionStateType枚举InstallSessionStateSqlServices类型的方法一起使用。The following code example shows how to use the SessionStateType enumeration with the InstallSessionState method of the SqlServices type.

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

适用于

另请参阅