Rediger

Del via


SqlServices.Install Method

Definition

Installs components for specified ASP.NET features on a SQL Server database.

Overloads

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.

Install(String, String, SqlFeatures)

Installs components for selected ASP.NET features on a SQL Server database.

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

Parameters

server
String

The database server on which to install the features.

database
String

The database on which to install the features.

features
SqlFeatures

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

Exceptions

Unable to connect to the specified database server.

The features value contains one or more invalid flags.

An exception occurred while processing the SQL statements required for the operation.

Examples

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

// Install all features.
SqlServices.Install(server, database,
    SqlFeatures.All);
' Install all features.
SqlServices.Install(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

Install(String, SqlFeatures, String)

Installs components for selected ASP.NET services on a SQL Server database.

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

Parameters

database
String

The database on which to install the features.

features
SqlFeatures

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

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 contains one or more invalid flags.

An exception occurred while processing the SQL statements required for the operation.

Examples

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

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

Remarks

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

See also

Applies to

Install(String, String, String, String, SqlFeatures)

Installs components for selected ASP.NET features on a SQL Server database.

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

Parameters

server
String

The database server on which to install 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 on which to install the features.

features
SqlFeatures

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

Exceptions

Unable to connect to the specified database server.

The features value contains one or more invalid flags.

An exception occurred while processing the SQL statements required for the operation.

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