Export (0) Print
Expand All

WebSecurity.InitializeDatabaseConnection Method (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.

Namespace:  WebMatrix.WebData
Assembly:  WebMatrix.WebData (in WebMatrix.WebData.dll)

public static void InitializeDatabaseConnection(
	string connectionStringName,
	string userTableName,
	string userIdColumn,
	string userNameColumn,
	bool autoCreateTables
)

Parameters

connectionStringName
Type: System.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
Type: System.String
The name of the database table that contains the user profile information.
userIdColumn
Type: System.String
The name of the database column that contains user IDs. This column must be typed as an integer (int).
userNameColumn
Type: System.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
Type: System.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.

For more information, see InitializeDatabaseConnection().

Show:
© 2014 Microsoft