Reputation: 3678
i changed my password format in the web.config for hashed to encrypted and added a machine key but after that i got this error :
Format of the initialization string does not conform to specification starting at index 0
i tried changing back to hashed but i still got this error.
here is the membership code:
<membership>
<providers>
<remove name="AspNetSqlMembershipProvider"/>
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionString="LocalSqlServer"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
applicationName="/"
requiresUniqueEmail="true"
minRequiredPasswordLength="6"
minRequiredNonalphanumericCharacters="0"
passwordFormat="Encrypted"
maxInvalidPasswordAttempts="5"
passwordAttemptWindow="10"
passwordStrengthRegularExpression=""/>
</providers>
</membership>
and connection string:
<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=AHMED-PC\SQLEXPRESS;Initial Catalog=test;Persist Security Info=True;User ID=sa;Password=123456" providerName="System.Data.SqlClient"/>
</connectionStrings>
note: the connection string was working fine before i changed the password format.
using asp.net 4.0
what is the problem, thanks.
Upvotes: 1
Views: 442
Reputation: 3678
solved it by attaching the ASPNETDB.MDF file and removing the Initial Catalog from the connection string:
<connectionStrings>
<remove name="localsqlserver"/>
<add name="localsqlserver" connectionString="Data Source=AHMED-PC\SQLEXPRESS;AttachDBFilename=|DataDirectory|aspnetdb.mdf;Persist Security Info=True;User ID=sa;Password=123456" providerName="System.Data.SqlClient"/>
</connectionStrings>
Upvotes: 1