Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am creating a custom .net membership provider. I understand the basics and have created a new class library(as I want to reuse this) with the relevant methods.

At the moment I have registered my custom provider in the web.config and if I add a break point to the methods, they are being called. My question though, is how can I access the connection string from my assembly? I reference a connection string when I add my provider in the web.config. This is what I have currently:

XML
<add name="DWMembership" type="DWMembership.Authentication" connectionStringName="ApplicationServices"
             enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
             maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
             applicationName="/" />


Any help would be great! Thanks in advance.
Posted

The REAL question is can you use google?

http://msdn.microsoft.com/en-us/library/ms178411.aspx#Y193[^]
 
Share this answer
 
v2
Comments
DominicZA 8-Mar-12 7:50am    
Ok, sorry, maybe I wasnt clear. I know how to read the connection string, but how do I get the name that is parsed in the connectionStingName attribute?
Ok, after some playing around I found out how to get it. If you override the Initialize method one of the parameters parsed is the collection of values you entered when adding the provider.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900