SqlServices.GenerateSessionStateScripts Method

Generates the SQL script for installing or removing session state. The script will reference the database indicated by the database parameter.

Namespace: System.Web.Management
Assembly: System.Web (in system.web.dll)

public:
static String^ GenerateSessionStateScripts (
	bool install, 
	SessionStateType type, 
	String^ customDatabase
)
public static String GenerateSessionStateScripts (
	boolean install, 
	SessionStateType type, 
	String customDatabase
)
public static function GenerateSessionStateScripts (
	install : boolean, 
	type : SessionStateType, 
	customDatabase : String
) : String
Not applicable.

Parameters

install

true to generate a script that installs the specified features; false to generate a script that removes the features.

type

One of the SessionStateType values, specifying the type of session state for which to generate scripts.

customDatabase

The name of the SQL Server database to use in the generated scripts.

Return Value

Returns the generated script code.

Exception typeCondition

ArgumentException

The type is Custom and the customDatabase value is not supplied, or the type is either Temporary or Persisted and the customDatabase value is not null.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: