WebSecurity - InitializeDatabaseConnection()
❮ 웹보안
정의
InitializeDatabaseConnection() 메서드 는 WebSecurity 데이터베이스를 초기화합니다.
이 메서드 는 사용자 및 구성원 정보가 포함된 데이터베이스에 연결 하여 WebSecurity 시스템을 초기화합니다 .
C# 및 VB 구문
WebSecurity.InitializeDatabaseConnection(connectionString, userTableName,
userIdColumn, userNameColumn, autoCreateTables)
매개변수
Parameter | Type | Description |
---|---|---|
connectionString | String |
The name of your WebSecurity database (se remarks) |
userTableName | String | The database table that contains the user profile information |
userIdColumn | String | The database column that contains the user IDs (primary keys) |
userNameColumn | String | The database column that contains the user names |
autoCreateTables | Boolean | true indicates that user profile and membership tables should be created if they do not exist, otherwise false |
반환 값
없음.
비고
SQL Server Compact를 사용하는 경우 connectionString 은 WebSecurity 데이터베이스의 이름이어야 합니다(.sdf 파일 이름 확장명 제외). 그렇지 않으면 웹 구성(web.config 파일)의 연결 문자열 이름이어야 합니다.
autoCreateTables 가 데이터베이스 테이블 을 자동으로 생성하도록 할 수 있다 하더라도 데이터베이스 자체는 항상 존재해야 합니다.
오류 및 예외
InitializeDatabaseConnection() 메서드는 다음 과 같은 경우 InvalidOperationException 을 발생시킵니다 .
- SimpleMembership 이 초기화되지 않았습니다(또는 웹사이트 구성에서 비활성화됨).
❮ 웹보안