वेब सुरक्षा - प्रारंभिकडेटाबेस कनेक्शन ()
❮ वेब सुरक्षा
परिभाषा
इनिशियलाइज़डेटाबेसकनेक्शन () विधि वेबसिक्योरिटी डेटाबेस को इनिशियलाइज़ करती है ।
उपयोगकर्ता और सदस्यता जानकारी वाले डेटाबेस से कनेक्ट करके यह विधि WebSecurity सिस्टम को इनिशियलाइज़ करती है।
सी # और वीबी सिंटेक्स
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 सर्वर कॉम्पैक्ट का उपयोग कर रहे हैं, तो कनेक्शनस्ट्रिंग वेब सुरक्षा डेटाबेस (.sdf फ़ाइल नाम एक्सटेंशन के बिना) का नाम होना चाहिए। अन्यथा यह वेब कॉन्फ़िगरेशन (web.config फ़ाइल) में एक कनेक्शन स्ट्रिंग का नाम होना चाहिए।
भले ही autoCreateTables डेटाबेस तालिकाओं को स्वचालित रूप से बनाने के लिए बाध्य कर सकता है, डेटाबेस स्वयं हमेशा मौजूद होना चाहिए।
त्रुटियाँ और अपवाद
इनिशियलाइज़डेटाबेसकनेक्शन () विधि एक अवैधऑपरेशन अपवाद फेंकता है यदि :
- SimpleMembership प्रारंभ नहीं किया गया है (या वेबसाइट कॉन्फ़िगरेशन में अक्षम है)
❮ वेब सुरक्षा