WebSecurity - InitializeDatabaseConnection()
❮ WebSecurity
အဓိပ္ပါယ်
InitializeDatabaseConnection() နည်းလမ်းသည် WebSecurity ဒေတာဘေ့စ်ကို အစပြုသည် ။
နည်းလမ်းသည် အသုံးပြုသူနှင့် အသင်းဝင်အချက်အလက်များပါရှိသော ဒေတာဘေ့စ်သို့ ချိတ်ဆက်ခြင်းဖြင့် WebSecurity စနစ်ကို စတင်စေသည်။
C# နှင့် VB Syntax
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 database (.sdf ဖိုင်အမည် extension မပါဘဲ) ၏အမည်ဖြစ်သင့်သည်။ မဟုတ်ပါက ၎င်းသည် ဝဘ်ဖွဲ့စည်းပုံစနစ် (web.config ဖိုင်) ရှိ ချိတ်ဆက်မှုစာကြောင်းတစ်ခု၏ အမည်ဖြစ်သင့်သည်။
autoCreateTables သည် ဒေတာဘေ့စ် ဇယား များကို အလိုအလျောက်ဖန်တီးရန် တွန်းအားပေးနိုင်သော်လည်း၊ ဒေ တာဘေ့စ် ကိုယ်တိုင် အမြဲတည်ရှိနေရမည်။
အမှားများနှင့် ခြွင်းချက်များ
InitializeDatabaseConnection () နည်းလမ်းသည် အကယ်၍ InvalidOperationException ကို လွှင့်ပစ်သည် -
- SimpleMembership ကို စတင်ခြင်းမပြုပါ (သို့မဟုတ် ဝဘ်ဆိုဒ်ဖွဲ့စည်းပုံတွင် ပိတ်ထားသည်)
❮ WebSecurity