views:

24

answers:

1

hi,

In my web application project I am using MYSQLMemberShipProvider. Now I want that instead of reading the connection string from web.config file, it will read the connection string from external file every time.

So that I am implementing the custom membership provider class, this class inherits the MembershipProvider class.

But the problem is that if I inherits the MembershipProvider class then I have to implement all of its method in my custom membership provider class, But I want to use all other inbuilt methods of Memebership. What can I do.

I only want to add the code like below:

public class CustomSqlMembershipProvider :MembershipProvider
{
    public override void Initialize(string name, NameValueCollection configs)
    {
        base.Initialize(name, configs);
        Connectionstring objProducts = // reading the connection string.
    }
}

But on compilation it is giving me the error does not implement inherit abstract member.

Please Suggest me any idea.

Thanks in advance
Aayushi

+1  A: 

What are your motivations for reading in the connection string from another file, is it purely to get a different connection string for debug/release environments? If that is the case you could use web.config transformations if you have VS2010. It is a very clean solution that may be of use to you.

Matt