Web Site Administration Tool - Provider Tab
How do you react if something is not simple when it is supposed to be? I tried to use Web Site Admin tool for my web site. The Provider tab was erroring out as
"Could not establish a connection to the database.
If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider. "
Ok I ran the aspnet_regsql to install and configure the DB.Still I could not use the Provider Management. You would think that if you manually add the <Membership> element in the web.config would help you.
<membership>
<providers>
<add connectionStringName="MylSqlServer" name="AspNetSqlProvider" Type="System.Web.Security.SqlMembershipProvider" />
</providers>
</membership>
Nope. Little bit Googling helped me to figure out what is the problem.1. You manually need to add the connection details within the <ConnectionStrings> section for the new aspnetDB
<add name="MySqlServer" connectionString="YOUR CONNECTION STRING" providerName="System.Data.SqlClient" />
2. Here is the tip.You also need to remove the entry before adding!!
<remove name="MySqlServer"/>
Why do you want to remove before adding? At least the error message could have been more informative.