<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Security</title><link>http://forums.asp.net/25.aspx</link><description>All about ASP.NET security (authentication, authorization, membership, roles, etc.) and the Login controls. &lt;a href="http://aspadvice.com/SignUp/list.aspx?l=24&amp;c=17" target="_blank"&gt;Email List&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Setting Membership/Profile/Role provider's connection string at runtime...?</title><link>http://forums.asp.net/thread/3320794.aspx</link><pubDate>Thu, 30 Jul 2009 08:18:02 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3320794</guid><dc:creator>markarmitage</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3320794.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=3320794</wfw:commentRss><description>&lt;p&gt;Hi Charcoal,&lt;/p&gt;&lt;p&gt;Did you find a solution to your custom role provider / config error? I&amp;#39;m using the same technique and am getting the exact same error as you describe on deployment (works locally though). &lt;/p&gt;&lt;p&gt;Thanks,&lt;/p&gt;&lt;p&gt;Mark&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Setting Membership/Profile/Role provider's connection string at runtime...?</title><link>http://forums.asp.net/thread/3150845.aspx</link><pubDate>Fri, 08 May 2009 14:24:46 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3150845</guid><dc:creator>pearsonbe</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3150845.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=3150845</wfw:commentRss><description>&lt;p&gt;Thanks. I got it to work. There must have been a problem in the C# to VB translation. Now, I&amp;#39;m trying to get Memebership access to work with a Linked Server. I haven&amp;#39;t found a solution for this yet.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Setting Membership/Profile/Role provider's connection string at runtime...?</title><link>http://forums.asp.net/thread/3114426.aspx</link><pubDate>Thu, 23 Apr 2009 21:30:27 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3114426</guid><dc:creator>charcoal</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3114426.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=3114426</wfw:commentRss><description>I have the same issue. Membership, Role, Profile custom providers work fine on my local IIS. I deploy this to production and no joy. &lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;using&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt; System.Web.Security;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;using&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; System.Reflection;&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;class&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;MyRoleProvider&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; : &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;SqlRoleProvider...&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;override&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; Initialize(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; name, System.Collections.Specialized.&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;NameValueCollection&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; config)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;base&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Initialize(name, config);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// Update the private connection string field in the base class.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;//Using a class that manages my connection strings. It will pass the correct one based on the server name the application is running on.&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;ServerConnect&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; sc = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;ServerConnect&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;();&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; connectionString = sc.GetConnectionString();&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// Set private property of Role provider.&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;FieldInfo&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; connectionStringField = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;typeof&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;SqlRoleProvider&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;).GetField(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;_sqlConnectionString&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;BindingFlags&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Instance | &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;BindingFlags&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.NonPublic);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (connectionStringField != &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;null&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)&lt;/p&gt;connectionStringField.SetValue(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, connectionString);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;&lt;/font&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;font color="#2b91af"&gt;web.config&lt;/font&gt;&lt;/p&gt;&lt;font color="#2b91af"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;profile&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;font color="#ff0000" size="2"&gt;defaultProvider&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;MyProfileProvider&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;font color="#ff0000" size="2"&gt;enabled&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;true&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt; 
&lt;p&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;providers&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;gt;&lt;/p&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;clear&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;/&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt; &amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;add&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;font color="#ff0000" size="2"&gt;name&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;MyProfileProvider&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;font color="#ff0000" size="2"&gt;connectionStringName&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;conn&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;font color="#ff0000" size="2"&gt;applicationName&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;CodersExpo&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;font color="#ff0000" size="2"&gt;type&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;MyProfileProvider&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000" size="2"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;/&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt; 
&lt;p&gt;&amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;providers&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/p&gt;&amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;profile&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt; 
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Everything works great on my box. I created roles, profile, members ...&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;On the remote I get an error like this:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;h2&gt;&lt;i&gt;Configuration Error&lt;/i&gt; &lt;/h2&gt;&lt;font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "&gt;&lt;b&gt;Description: &lt;/b&gt;An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Parser Error Message: &lt;/b&gt;System.Web.Security.SqlRoleProvider._sqlConnectionString&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Source Error:&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;
&lt;table class="" bgcolor="#ffffcc"&gt;

&lt;tr&gt;
&lt;td class=""&gt;&lt;code&gt;&lt;pre&gt;Line 54: 			&amp;lt;providers&amp;gt;
Line 55: 				&amp;lt;clear/&amp;gt;
&lt;font color="red"&gt;Line 56: 				&amp;lt;add name=&amp;quot;MyRoleProvider&amp;quot; connectionStringName=&amp;quot;conn&amp;quot; applicationName=&amp;quot;CodersExpo&amp;quot; type=&amp;quot;MyRoleProvider&amp;quot;/&amp;gt;
&lt;/font&gt;Line 57: 			&amp;lt;/providers&amp;gt;
Line 58: 		&amp;lt;/roleManager&amp;gt;&lt;/pre&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;b&gt;&lt;font face="Verdana"&gt;Source File: &lt;/font&gt;&lt;/b&gt;d:\hosting\charcoaldev\web.config&lt;b&gt;&lt;font face="Verdana"&gt; &amp;nbsp;&amp;nbsp; Line: &lt;/font&gt;&lt;/b&gt;56 &lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "&gt;
&lt;hr /&gt;

&lt;p&gt;&lt;b&gt;&lt;font face="Verdana"&gt;Version Information:&lt;/font&gt;&lt;/b&gt;&amp;nbsp;Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433 &lt;/p&gt;
&lt;p&gt;&amp;nbsp;I don&amp;#39;t get it??? Please help. I know the remote connection string is correct because I can query the DB.&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;</description></item><item><title>Re: Setting Membership/Profile/Role provider's connection string at runtime...?</title><link>http://forums.asp.net/thread/2985564.aspx</link><pubDate>Thu, 05 Mar 2009 18:34:48 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2985564</guid><dc:creator>pearsonbe</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2985564.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2985564</wfw:commentRss><description>&lt;p&gt;Thanks, Gewgala. I know it&amp;#39;s been a while since you responded, but I finally got back to this in my project. The C# code code works fine as you and others have stated. The code I converted to VB works for the Membership provider, but not the RoleProvider. I don&amp;#39;t know why. Of course, it could be something with the translation. I&amp;#39;m not up on reflection yet.&lt;/p&gt;&lt;p&gt;Next, up is finding a way to integrate this with our shops standard data access layer. I found a good article on another site that may prove very useful.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Setting Membership/Profile/Role provider's connection string at runtime...?</title><link>http://forums.asp.net/thread/2955176.aspx</link><pubDate>Fri, 20 Feb 2009 16:07:06 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2955176</guid><dc:creator>akakar</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2955176.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2955176</wfw:commentRss><description>&lt;p&gt;My application supports failover and we&amp;#39;re using SQLEXPRESS so no DB capability exists for doing this.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using a custom Profile Provider which works to initially set the connection string at runtime but I now need the capability to modify the connection string a second time to update the failover machine.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve tried recalling the &amp;quot;Initialize&amp;quot; routine to get this to work and it runs and looks like the connection is changed but the provider&amp;#39;s connection string is never changed.&lt;/p&gt;
&lt;p&gt;Any help is greatly appreciated.&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Setting Membership/Profile/Role provider's connection string at runtime...?</title><link>http://forums.asp.net/thread/2862586.aspx</link><pubDate>Mon, 12 Jan 2009 17:10:40 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2862586</guid><dc:creator>Gewgala</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2862586.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2862586</wfw:commentRss><description>Not a single issue, it just worked.  One thing I did differently was I erased &amp;quot;, MyAssembly&amp;quot; in the &amp;quot;type&amp;quot; property as shown below, as I&amp;#39;m working on a regular website:

&amp;lt;add name=&amp;quot;MyMembershipProvider&amp;quot; type=&amp;quot;MyNamespace.MyMembershipProvider&amp;quot; ... /&amp;gt;</description></item><item><title>Re: Setting Membership/Profile/Role provider's connection string at runtime...?</title><link>http://forums.asp.net/thread/2861782.aspx</link><pubDate>Mon, 12 Jan 2009 10:49:51 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2861782</guid><dc:creator>pearsonbe</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2861782.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2861782</wfw:commentRss><description>&lt;p&gt;Gewgala, so you didn&amp;#39;t have any issues? I still haven&amp;#39;t had it work in the VB version I created so I think I&amp;#39;ll try using the exact code in C#.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Setting Membership/Profile/Role provider's connection string at runtime...?</title><link>http://forums.asp.net/thread/2849011.aspx</link><pubDate>Tue, 06 Jan 2009 07:46:52 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2849011</guid><dc:creator>Gewgala</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2849011.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2849011</wfw:commentRss><description>&lt;p&gt;RGabo and Antmx - THANK YOU!&amp;nbsp; That&amp;#39;s exactly what I needed.&amp;nbsp; Searched all over the internet and finally found this thread, I did exactly what you did Antmx and it works like a charm!&lt;/p&gt;</description></item><item><title>Re: Setting Membership/Profile/Role provider's connection string at runtime...?</title><link>http://forums.asp.net/thread/2825173.aspx</link><pubDate>Mon, 22 Dec 2008 18:15:49 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2825173</guid><dc:creator>pearsonbe</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2825173.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2825173</wfw:commentRss><description>&lt;p&gt;Since the compiler is telling me it can&amp;#39;t find the type (in the *dll), i am going to try putting the code in a separate project and copying to the bin folder.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Setting Membership/Profile/Role provider's connection string at runtime...?</title><link>http://forums.asp.net/thread/2825115.aspx</link><pubDate>Mon, 22 Dec 2008 17:45:55 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2825115</guid><dc:creator>pearsonbe</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2825115.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2825115</wfw:commentRss><description>&lt;p&gt;antmx, does this have to go into a separate project from the main one where it is used? I simply created a new class within my main project (LT) like so:&lt;/p&gt;&lt;p&gt;==== In Class COBWEBMembershipProvider.vb&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Imports System.Reflection&lt;br /&gt;&lt;br /&gt;Namespace COBWEB&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Class COBWEBMembershipProvider&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Inherits SqlMembershipProvider&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Overrides Sub Initialize(ByVal name As String, ByVal config As System.Collections.Specialized.NameValueCollection)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.Initialize(name, config)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39; Update the private connection string field in the base class.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim connString As String = &amp;quot;Data Source=Some Connection String Here&amp;quot;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39; Set private membership provider property. Reflection is used to discover the attributes of a field and&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39; provide access to the field metadata.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39; Note: Not sure about the parameter for GetType. C# example did not have it, but VB needs something.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim connStringField As FieldInfo = GetType(FieldInfo).BaseType.GetField(&amp;quot;_sqlConnectionString&amp;quot;, BindingFlags.Instance Or _&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BindingFlags.NonPublic)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connStringField.SetValue(Me, connString)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Class&lt;br /&gt;End Namespace &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Add added this to my web.config &lt;br /&gt;&lt;/p&gt;&lt;p&gt;===== In Web.Config &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;membership defaultProvider=&amp;quot;COBWEBMembershipProvider&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;providers&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;clear/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add name=&amp;quot;COBWEBMembershipProvider&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type=&amp;quot;COBWEB.COBWEBMembershipProvider, LT&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connectionStringName=&amp;quot;LTDummy&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; applicationName=&amp;quot;LT&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; enablePasswordRetrieval=&amp;quot;false&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; enablePasswordReset=&amp;quot;true&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; minRequiredPasswordLength=&amp;quot;5&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; requiresQuestionAndAnswer=&amp;quot;true&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; requiresUniqueEmail=&amp;quot;false&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; passwordFormat=&amp;quot;Hashed&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxInvalidPasswordAttempts=&amp;quot;5&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; minRequiredNonalphanumericCharacters=&amp;quot;0&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; passwordAttemptWindow=&amp;quot;10&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; passwordStrengthRegularExpression=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/providers&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/membership&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;But i get this error: &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;System Message:&lt;/b&gt; Could not load type &amp;#39;COBWEB.COBWEBMembershipProvider&amp;#39; 
from assembly &amp;#39;LT&amp;#39;. (C:\Inetpub\wwwroot\LT\LT\LT\web.config line 33) &lt;/p&gt;&lt;p&gt;&amp;nbsp;I&amp;#39;m looling at the Toolkit Sample Providers now.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Setting Membership/Profile/Role provider's connection string at runtime...?</title><link>http://forums.asp.net/thread/2660200.aspx</link><pubDate>Fri, 03 Oct 2008 00:00:48 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2660200</guid><dc:creator>antmx</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2660200.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2660200</wfw:commentRss><description>&lt;p&gt;RGabo you&amp;#39;re a star. Your post prompted me to create my own custom SqlMembershipProvider class to tidy this up.&lt;/p&gt;&lt;pre class="coloredcode"&gt;&lt;span class="kwd"&gt;namespace&lt;/span&gt; MyNamespace
{
	&lt;span class="kwd"&gt;public class&lt;/span&gt; MyMembershipProvider : SqlMembershipProvider
	{
		&lt;span class="kwd"&gt;public override void&lt;/span&gt; Initialize(&lt;span class="kwd"&gt;string&lt;/span&gt; name, System.Collections.Specialized.NameValueCollection config)
		{
			&lt;span class="kwd"&gt;base&lt;/span&gt;.Initialize(name, config);

			&lt;span class="cmt"&gt;// Update the private connection string field in the base class.&lt;/span&gt;
			&lt;span class="kwd"&gt;string&lt;/span&gt; connectionString = &amp;quot;my new connection string value that I get from a custom decryption class not shown here&amp;quot;&lt;/pre&gt;&lt;pre class="coloredcode"&gt;			&lt;span class="cmt"&gt;// Set private property of Membership provider.&lt;/span&gt;
			FieldInfo connectionStringField = GetType().BaseType.GetField(&amp;quot;_sqlConnectionString&amp;quot;, BindingFlags.Instance | BindingFlags.NonPublic);
			connectionStringField.SetValue(this, connectionString);
		}
	}
}&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;Then in app/web.config I put this:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="coloredcode"&gt;		&amp;lt;&lt;span class="tag"&gt;membership&lt;/span&gt;&lt;span class="attr"&gt; defaultProvider=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;MyMembershipProvider&amp;quot;&lt;/span&gt;&amp;gt;
			&amp;lt;&lt;span class="tag"&gt;providers&lt;/span&gt;&amp;gt;
				&amp;lt;&lt;span class="tag"&gt;clear&lt;/span&gt; /&amp;gt;
				&amp;lt;&lt;span class="tag"&gt;add&lt;/span&gt;&lt;span class="attr"&gt; name=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;MyMembershipProvider&amp;quot;&lt;/span&gt;
&lt;span class="attr"&gt;					  type=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;MyNamespace.MyMembershipProvider, MyAssembly&amp;quot;&lt;/span&gt;
&lt;span class="attr"&gt;					  connectionStringName=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;name of a real but dummy connection string from the connectionStrings section that will never actually get used. Its value could just be &amp;#39;x&amp;#39;&amp;quot;&lt;/span&gt; 
&lt;span class="attr"&gt;					  applicationName=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;MyApp&amp;quot;&lt;/span&gt; 
&lt;span class="attr"&gt;					  enablePasswordRetrieval=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;false&amp;quot;&lt;/span&gt; 
&lt;span class="attr"&gt;					  enablePasswordReset=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;true&amp;quot;&lt;/span&gt; 
&lt;span class="attr"&gt;					  requiresQuestionAndAnswer=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;false&amp;quot;&lt;/span&gt; 
&lt;span class="attr"&gt;					  requiresUniqueEmail=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;false&amp;quot;&lt;/span&gt; 
&lt;span class="attr"&gt;					  minRequiredNonalphanumericCharacters=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;0&amp;quot;&lt;/span&gt; 
&lt;span class="attr"&gt;					  passwordFormat=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;Hashed&amp;quot;&lt;/span&gt; /&amp;gt;
			&amp;lt;/&lt;span class="tag"&gt;providers&lt;/span&gt;&amp;gt;
		&amp;lt;/&lt;span class="tag"&gt;membership&lt;/span&gt;&amp;gt;&lt;/pre&gt;&amp;nbsp; 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Setting Membership/Profile/Role provider's connection string at runtime...?</title><link>http://forums.asp.net/thread/2577344.aspx</link><pubDate>Mon, 25 Aug 2008 02:06:20 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2577344</guid><dc:creator>RGabo</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2577344.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2577344</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;A simpler, albeit somewhat eyebrow-raising solution is just modifying the connection string in the providers early enough in the request&amp;#39;s lifecycle:&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void SetProviderConnectionString(string connectionString)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Set private property of Membership, Role and Profile providers. Do not try this at home!!&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var connectionStringField = Membership.Provider.GetType().GetField(&amp;quot;_sqlConnectionString&amp;quot;, BindingFlags.Instance | BindingFlags.NonPublic);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (connectionStringField != null)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connectionStringField.SetValue(Membership.Provider, connectionString);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var roleField = Roles.Provider.GetType().GetField(&amp;quot;_sqlConnectionString&amp;quot;, BindingFlags.Instance | BindingFlags.NonPublic);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (roleField != null)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; roleField.SetValue(Roles.Provider, connectionString);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var profileField = ProfileManager.Provider.GetType().GetField(&amp;quot;_sqlConnectionString&amp;quot;, BindingFlags.Instance | BindingFlags.NonPublic);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (profileField != null)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; profileField.SetValue(ProfileManager.Provider, connectionString);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp;Calling this method from Global.asax.cs inside Application_PreRequestHandlerExecute does the job. Haven&amp;#39;t tested it too much, but even if something doesn&amp;#39;t work, it just means it needs to be done earlier. No guarantees this will work with future versions of the framework, although most likely it will.&lt;/p&gt;&lt;p&gt;Gabor &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Setting Membership/Profile/Role provider's connection string at runtime...?</title><link>http://forums.asp.net/thread/2211924.aspx</link><pubDate>Tue, 04 Mar 2008 20:50:21 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2211924</guid><dc:creator>BDawg</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2211924.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2211924</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;OK figured it out...and my multi national company is now saved...ha ha&lt;/p&gt;&lt;p&gt; This is a one liner gang........&lt;/p&gt;&lt;p&gt;you will need to create your own providers however, We simply downloaded the SampleProviderToolkitSampleProviders from microsoft to lessen the blow.&lt;br /&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://download.microsoft.com/download/a/b/3/ab3c284b-dc9a-473d-b7e3-33bacfcc8e98/ProviderToolkitSamples.msi" target="_blank"&gt;http://download.microsoft.com/download/a/b/3/ab3c284b-dc9a-473d-b7e3-33bacfcc8e98/ProviderToolkitSamples.msi&lt;/a&gt; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;Class to modify&lt;/p&gt;&lt;p&gt;SQLConnectionHelper.cs&lt;/p&gt;&lt;p&gt;Method to modify &lt;/p&gt;&lt;p&gt;--------------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;internal static string GetConnectionString(string specifiedConnectionString, bool lookupConnectionString, bool appLevel)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&lt;br /&gt;//Your Conn String goes here!!&lt;/p&gt;&lt;p&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return Factory.ConnectionString;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;--------------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br /&gt;we used our own namespace to be used in the web.congif as well.&lt;/p&gt;&lt;p&gt;complile that bad boy and your golden..&lt;/p&gt;&lt;p&gt;have fun&lt;br /&gt;&lt;/p&gt;&lt;p&gt;--b&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Setting Membership/Profile/Role provider's connection string at runtime...?</title><link>http://forums.asp.net/thread/2209437.aspx</link><pubDate>Mon, 03 Mar 2008 22:57:46 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2209437</guid><dc:creator>BDawg</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2209437.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2209437</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Sounds like your agency is working for the same multi national company that&amp;nbsp; mine is. any one find anything on this??&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;--B &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Setting Membership/Profile/Role provider's connection string at runtime...?</title><link>http://forums.asp.net/thread/2113160.aspx</link><pubDate>Wed, 16 Jan 2008 16:25:34 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2113160</guid><dc:creator>pliant</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2113160.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2113160</wfw:commentRss><description>&lt;p&gt;did you ever find a solution to this?&lt;/p&gt;</description></item></channel></rss>