SqlServices Class
Supports installing and removing the SQL Server database elements of ASP.NET features.
Assembly: System.Web (in System.Web.dll)
The SqlServices type exposes the following members.
| Name | Description | |
|---|---|---|
![]() ![]() | GenerateApplicationServicesScripts | Generates the SQL scripts for the selected features. The scripts will reference the database indicated by the database parameter. |
![]() ![]() | GenerateSessionStateScripts | Generates the SQL script for installing or removing session state. The script will reference the database indicated by the database parameter. |
![]() ![]() | Install(String, String, SqlFeatures) | Installs components for selected ASP.NET features on a SQL Server database. |
![]() ![]() | Install(String, SqlFeatures, String) | Installs components for selected ASP.NET services on a SQL Server database. |
![]() ![]() | Install(String, String, String, String, SqlFeatures) | Installs components for selected ASP.NET features on a SQL Server database. |
![]() ![]() | InstallSessionState(String, String, SessionStateType) | Installs components for ASP.NET session state on a SQL Server database. |
![]() ![]() | InstallSessionState(String, SessionStateType, String) | Installs components for ASP.NET session state on a SQL Server database. |
![]() ![]() | InstallSessionState(String, String, String, String, SessionStateType) | Installs components for ASP.NET session state on a SQL Server database. |
![]() ![]() | Uninstall(String, String, SqlFeatures) | Removes components for selected ASP.NET features from a SQL Server database. |
![]() ![]() | Uninstall(String, SqlFeatures, String) | Removes components for selected ASP.NET features from a SQL Server database. |
![]() ![]() | Uninstall(String, String, String, String, SqlFeatures) | Removes components for selected ASP.NET features from a SQL Server database. |
![]() ![]() | UninstallSessionState(String, String, SessionStateType) | Removes components for ASP.NET session state from a SQL Server database. |
![]() ![]() | UninstallSessionState(String, SessionStateType, String) | Removes components for ASP.NET session state from a SQL Server database. |
![]() ![]() | UninstallSessionState(String, String, String, String, SessionStateType) | Removes components for ASP.NET session state from a SQL Server database. |
You can use SQL Server databases to store information for ASP.NET features such as session state, membership, Web parts personalization, and role management. These features require that the SQL Server database to which they are connected be properly configured before use. You can use the ASP.NET Register SQL tool (aspnet_regsql.exe) to do this, or you can call the static methods exposed by the SqlServices class directly from your code.
Note |
|---|
Using the aspnet_regsql.exe tool or the SqlServices class to configure the database only sets up the database that the providers will use with the proper tables, triggers, and stored procedures. Configuring the database in this way does not modify configuration files to specify that these features use the SQL Providers for these services. |
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.


Note