开发者

Custom Membership provider that would read connection string from custom file

开发者 https://www.devze.com 2023-01-16 22:09 出处:网络
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 e

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 Ini开发者_开发知识库tialize(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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消