Last post May 02, 2011 11:29 PM by mahmoudSayed
May 02, 2011 11:29 PM|mahmoudSayed|LINK
I had such a hard time fixing this error, and I've just fix it :)
This issue haapen when I used Logins and Membership provider with my ASP.NET and SQL Server2008
Away from editing SQLServer configuration TCP/IP and away from adding ports to the firewall or disable firewal settings...
Simply the problem is:
Asp.net is using machine.config (C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG) settings to deal with SQL server when you're using .NET Membership and logins services... and yes you can use (aspnet_regsql) to let .NET know that the DBEngine is not Express,
it's SQLServer instance.
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=126.96.36.199, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true"
requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression=""/>
Inside the web.config or machine.config AspNetSqlMembershipProvider needs a connection to the DBengine eather it was Express or Instance...
OKAY enough talking, to fix this issue,
Add LocalSqlServer connection string to your web.config AND don't change the neme it has to be LocalSqlServer inside web.config
<add name="aspnetConnectionString" connectionString="Data Source=.;Initial Catalog=MainAppConnection;Integrated Security=True" providerName="System.Data.SqlClient"/>
<add name="LocalSqlServer" connectionString="Data Source=.;Initial Catalog=aspnetdb;Integrated Security=True" providerName="System.Data.SqlClient"/>
that's worked for me... and again the issue is not in SQL server configuration, the issue is in Membership and roles provider
MCSD/MCPD Technical Trainer