SqlServices.Uninstall Method

Definition

Removes components for selected ASP.NET features from a SQL Server database.

Overloads

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.

Uninstall(String, String, SqlFeatures)

Removes components for selected ASP.NET features from a SQL Server database.

public:
 static void Uninstall(System::String ^ server, System::String ^ database, System::Web::Management::SqlFeatures features);
public static void Uninstall (string server, string database, System.Web.Management.SqlFeatures features);
static member Uninstall : string * string * System.Web.Management.SqlFeatures -> unit
Public Shared Sub Uninstall (server As String, database As String, features As SqlFeatures)

Parameters

server
String

The SQL Server instance from which to remove the features.

database
String

The database from which to remove the features.

features
SqlFeatures

A bitwise combination of the SqlFeatures values, specifying the features to remove.

Exceptions

Unable to connect to the specified database server.

The features value contained one or more invalid flags.

An exception occurred while processing the SQL statements required for the operation, an attempt was made to uninstall from a nonexistent database, or one or more tables for the features in the specified database contained data.

Examples

The following code example shows how to use the Uninstall(String, String, SqlFeatures) method of the SqlServices class.

// Remove all features.
SqlServices.Uninstall(server, database,
    SqlFeatures.All);
' Remove all features.
SqlServices.Uninstall(server, database, _
    SqlFeatures.All)

Remarks

If database is null or not supplied, SqlServices will use the default database, aspnetdb. If server is null or not supplied, SqlServices will use the default SQL Server instance.

Note

The connection to the database server is made with a trusted connection.

See also

Applies to

Uninstall(String, SqlFeatures, String)

Removes components for selected ASP.NET features from a SQL Server database.

public:
 static void Uninstall(System::String ^ database, System::Web::Management::SqlFeatures features, System::String ^ connectionString);
public static void Uninstall (string database, System.Web.Management.SqlFeatures features, string connectionString);
static member Uninstall : string * System.Web.Management.SqlFeatures * string -> unit
Public Shared Sub Uninstall (database As String, features As SqlFeatures, connectionString As String)

Parameters

database
String

The database from which to remove the features.

features
SqlFeatures

A bitwise combination of the SqlFeatures values, specifying the features to remove.

connectionString
String

The connection string to use. The connection string is only used to establish a connection to the database server. Specifying a database in the connection string has no effect.

Exceptions

Unable to connect to the specified database server.

The features value contained one or more invalid flags.

An exception occurred while processing the SQL statements required for the operation, an attempt was made to uninstall from a nonexistent database, or one or more tables for the features in the specified database contained data.

Examples

The following code example shows how to use the Uninstall method of the SqlServices type.

// Remove membership and personalization.
SqlServices.Uninstall(database,
    SqlFeatures.Membership &
    SqlFeatures.Personalization,
    connectionString);
' Remove membership and personalization.
SqlServices.Uninstall(database, _
    SqlFeatures.Membership And _
    SqlFeatures.Personalization, _
    connectionString)

Remarks

If database is null or not supplied, SqlServices will use the default database aspnetdb.

Note

The connection to the database server is made with a trusted connection.

See also

Applies to

Uninstall(String, String, String, String, SqlFeatures)

Removes components for selected ASP.NET features from a SQL Server database.

public:
 static void Uninstall(System::String ^ server, System::String ^ user, System::String ^ password, System::String ^ database, System::Web::Management::SqlFeatures features);
public static void Uninstall (string server, string user, string password, string database, System.Web.Management.SqlFeatures features);
static member Uninstall : string * string * string * string * System.Web.Management.SqlFeatures -> unit
Public Shared Sub Uninstall (server As String, user As String, password As String, database As String, features As SqlFeatures)

Parameters

server
String

The SQL Server instance from which to remove the features.

user
String

The user name to use when connecting to the database.

password
String

The password to use when connecting to the database.

database
String

The database from which to remove the features.

features
SqlFeatures

A bitwise combination of the SqlFeatures values, specifying the features to remove.

Exceptions

Unable to connect to the specified database server.

The features value contained one or more invalid flags.

An exception occurred while processing the SQL statements required for the operation, an attempt was made to uninstall from a nonexistent database, or one or more tables for the features in the specified database contained data.

Remarks

If database is null or not supplied, SqlServices will use the default database, aspnetdb. If server is null or not supplied, SqlServices will use the default SQL Server instance.

Note

The connection to the database server is made with a trusted connection.

See also

Applies to