SqlServices.GenerateSessionStateScripts 方法

定义

生成用于安装或移除会话状态的 SQL 脚本。 脚本将引用由数据库参数指示的数据库。

public:
 static System::String ^ GenerateSessionStateScripts(bool install, System::Web::Management::SessionStateType type, System::String ^ customDatabase);
public static string GenerateSessionStateScripts (bool install, System.Web.Management.SessionStateType type, string customDatabase);
static member GenerateSessionStateScripts : bool * System.Web.Management.SessionStateType * string -> string
Public Shared Function GenerateSessionStateScripts (install As Boolean, type As SessionStateType, customDatabase As String) As String

参数

install
Boolean

如果为 true,则生成安装指定功能的脚本;如果为 false,则生成移除功能的脚本。

type
SessionStateType

SessionStateType 值之一,指定为其生成脚本的会话状态的类型。

customDatabase
String

生成的脚本中使用的 SQL Server 数据库的名称。

返回

String

返回生成的脚本代码。

例外

类型是 Custom 并且未提供 customDatabase 值,或者类型是 TemporaryPersisted 并且 customDatabase 值不为空。

适用于

另请参阅