Godaddy ASP.NET membership database woes

痞子三分冷 提交于 2019-11-29 11:53:11
The_AlienCoder

I hope my experience benefits every one. Basically if you want to avoid aspnet membership problems on godaddy always use "LocalSqlServer" as the connectionstring. i.e

<providers>
    <remove name="AspNetSqlMembershipProvider" />
    <add name="AspNetSqlMembershipProvider" connectionStringName="LocalSqlServer"
        ..other attributes here... />
</providers>

Then create the "LocalSqlServer" connectionString...remember to remove it first

<connectionStrings>
    <remove name="LocalSqlServer"/>
    <add name="LocalSqlServer"
        connectionString="Data Source=xxxx; Initial Catalog=xxx; User ID=xxx; Password=xxx;"
        providerName="System.Data.SqlClient" />
</connectionStrings>

I ran into same problem and am using MVC3. Above solution works but with some other changes in MVC3. It took me long time to figure it out so if anybody has similar issue in MVC3 it might help them:

Search for "connectionStringName" in web.config and replace the name with connectionStringName="LocalSqlServer"

Also under connectionstrings make sure

-To add (As this is important for all who are using shared hosting it will replace machine.config LocalSqlServer connectionstring with yours.) -Keep your current connectionstring (In my case it is FilmiDb, this is required for you to connect to the database in EF model. Without this you will get errors.)

<connectionStrings>
    <remove name ="LocalSqlServer"/>
    <add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Initial Catalog=SofilmiDb;Integrated Security=SSPI" providerName="System.Data.SqlClient" />
    <add name="FilmiDb" connectionString="Data Source=.\SQLExpress;Initial Catalog=FilmiDb;Integrated Security=SSPI" providerName="System.Data.SqlClient" />
  </connectionStrings>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!