开发者

sqlrole manager dynamically add a connection string and or provider

开发者 https://www.devze.com 2023-02-20 03:27 出处:网络
how can I add a connection string dynamically to role manager? I\'m using asp.net mvc 3 with forms authentication and since this is SAAS app the connection string for each client will change dynamica

how can I add a connection string dynamically to role manager?

I'm using asp.net mvc 3 with forms authentication and since this is SAAS app the connection string for each client will change dynamically now I can create new datacontext based on dynamic connection string but is there a way to provide same connection string to role manager?

currently rolemanger is configured using web.config as follows (example only not actual file)

<roleManager enabled="t开发者_JAVA技巧rue">
            <providers>
                <clear />
                <add connectionStringName="blahblah">
</roleManager>


This post and this post seem to be doing exactly that (If I understand your post correctly).

Basically it's using the ConfigurationManager class to modify the connectionstring, or any value for that matter, of the web.config

Hopes this leads you in the right direction.

0

精彩评论

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