WebSecurity.InitializeDatabaseConnection Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
InitializeDatabaseConnection(String, String, String, String, Boolean) |
Initializes the membership system by connecting to a database that contains user information and optionally creates membership tables if they do not already exist. |
InitializeDatabaseConnection(String, String, String, String, Boolean, SimpleMembershipProviderCasingBehavior) | |
InitializeDatabaseConnection(String, String, String, String, String, Boolean) |
Initializes the membership system by connecting to a database that contains user information by using the specified membership or role provider, and optionally creates membership tables if they do not already exist. |
InitializeDatabaseConnection(String, String, String, String, String, Boolean, SimpleMembershipProviderCasingBehavior) |
InitializeDatabaseConnection(String, String, String, String, Boolean)
Initializes the membership system by connecting to a database that contains user information and optionally creates membership tables if they do not already exist.
public static void InitializeDatabaseConnection (string connectionStringName, string userTableName, string userIdColumn, string userNameColumn, bool autoCreateTables);
static member InitializeDatabaseConnection : string * string * string * string * bool -> unit
Public Shared Sub InitializeDatabaseConnection (connectionStringName As String, userTableName As String, userIdColumn As String, userNameColumn As String, autoCreateTables As Boolean)
Parameters
- connectionStringName
- String
The name of the connection string for the database that contains user information. If you are using SQL Server Compact, this can be the name of the database file (.sdf file) without the .sdf file name extension.
- userTableName
- String
The name of the database table that contains the user profile information.
- userIdColumn
- String
The name of the database column that contains user IDs. This column must be typed as an integer (int).
- userNameColumn
- String
The name of the database column that contains user names. This column is used to match user profile data to membership account data.
- autoCreateTables
- Boolean
true to indicate that user profile and membership tables should be created if they do not exist; false to indicate that tables should not be created automatically. Although the membership tables can be created automatically, the database itself must already exist.
Applies to
InitializeDatabaseConnection(String, String, String, String, Boolean, SimpleMembershipProviderCasingBehavior)
public static void InitializeDatabaseConnection (string connectionStringName, string userTableName, string userIdColumn, string userNameColumn, bool autoCreateTables, WebMatrix.WebData.SimpleMembershipProviderCasingBehavior casingBehavior);
static member InitializeDatabaseConnection : string * string * string * string * bool * WebMatrix.WebData.SimpleMembershipProviderCasingBehavior -> unit
Public Shared Sub InitializeDatabaseConnection (connectionStringName As String, userTableName As String, userIdColumn As String, userNameColumn As String, autoCreateTables As Boolean, casingBehavior As SimpleMembershipProviderCasingBehavior)
Parameters
- connectionStringName
- String
- userTableName
- String
- userIdColumn
- String
- userNameColumn
- String
- autoCreateTables
- Boolean
- casingBehavior
- SimpleMembershipProviderCasingBehavior
Applies to
InitializeDatabaseConnection(String, String, String, String, String, Boolean)
Initializes the membership system by connecting to a database that contains user information by using the specified membership or role provider, and optionally creates membership tables if they do not already exist.
public static void InitializeDatabaseConnection (string connectionString, string providerName, string userTableName, string userIdColumn, string userNameColumn, bool autoCreateTables);
static member InitializeDatabaseConnection : string * string * string * string * string * bool -> unit
Public Shared Sub InitializeDatabaseConnection (connectionString As String, providerName As String, userTableName As String, userIdColumn As String, userNameColumn As String, autoCreateTables As Boolean)
Parameters
- connectionString
- String
The name of the connection string for the database that contains user information. If you are using SQL Server Compact, this can be the name of the database file (.sdf file) without the .sdf file name extension.
- providerName
- String
The name of the ADO.NET data provider. If you want to use Microsoft SQL Server, the InitializeDatabaseConnection(String, String, String, String, Boolean) overload is recommended.
- userTableName
- String
The name of the database table that contains the user profile information.
- userIdColumn
- String
The name of the database column that contains user IDs. This column must be typed as an integer (int).
- userNameColumn
- String
The name of the database column that contains user names. This column is used to match user profile data to membership account data.
- autoCreateTables
- Boolean
true to indicate that user profile and membership tables should be created automatically; false to indicate that tables should not be created automatically. Although the membership tables can be created automatically, the database itself must already exist.
Applies to
InitializeDatabaseConnection(String, String, String, String, String, Boolean, SimpleMembershipProviderCasingBehavior)
public static void InitializeDatabaseConnection (string connectionString, string providerName, string userTableName, string userIdColumn, string userNameColumn, bool autoCreateTables, WebMatrix.WebData.SimpleMembershipProviderCasingBehavior casingBehavior);
static member InitializeDatabaseConnection : string * string * string * string * string * bool * WebMatrix.WebData.SimpleMembershipProviderCasingBehavior -> unit
Public Shared Sub InitializeDatabaseConnection (connectionString As String, providerName As String, userTableName As String, userIdColumn As String, userNameColumn As String, autoCreateTables As Boolean, casingBehavior As SimpleMembershipProviderCasingBehavior)
Parameters
- connectionString
- String
- providerName
- String
- userTableName
- String
- userIdColumn
- String
- userNameColumn
- String
- autoCreateTables
- Boolean
- casingBehavior
- SimpleMembershipProviderCasingBehavior