ความปลอดภัยของเว็บ - 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ไม่ได้เริ่มต้น (หรือปิดใช้งานในการกำหนดค่าเว็บไซต์)
❮ ความปลอดภัยของเว็บ