asp.net membership - .Net RoleProvider without the connectionString -


I would like to use the net's SQL Ampression Provider and SqlRoleProvider for user management in my application. My problem is that when the application starts, it does not know the information of any DB connection. For security purposes, this information has to be obtained from the WCF service running on the database server. So I need to build since its membership / role providers-fact.

I think I am working to create and add a membership provider:

  // register membership provider var membership = new SqlMembershipProvider (); Var Providers = New NameValues ​​(); the provider. Add value ("name", "SQL ambulance provider"); Provider Add ("Application Name", "/"); Provider Brands Add ("connectionstringName", "connectionStrDynamAddedToConfig"); Provider, value. Add ("Max Translation Password Search", "10"); Membership Start ("sqlMembershipProvider", Provider Valve);  

I am unable to do something similar to make RoleProvider yet. I have to build provider, but it can not add role manager I need to create a custom provider that can already be a connection Stallings after the start?

As I ran special, GetConnectionString function that looks something like this "

< pre> internal static string GetConnectionString (string specified CONNECTIONString, bool lookupConnectionString, bool appLevel) {if (specified CONNECTIONString == null; specified CONNECTIONString.Length & lt; 1) return null; string connection string = null; /// //////////////////////////////////// Step 1: Check & lt; Connection Best & gt; Config section for this connection string if (lookupConnectionString) {ConnectionStringSettings connObj = Config urationManager.ConnectionStrings [specifiedConnectionString]; If (connObj! = Null) connectionString = connObj.ConnectionString; if (connectionString == null) return null;} else {connectionString = specified CONNECTIONString;} return connection string;}} <


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -