Godaddy ASP.NET membership database woes
Asked Answered
C

2

3

I purchased a Windows shared hosting account on godaddy that came with 2 MSSQL databases. I setup one to hold my site data and the other installed aspnet membership schema to store site members. The site works perfectly even displaying data from the 1st database. However when I try to login or register I get this nasty error

Exception Details: System.Configuration.Provider.ProviderException: The SSE Provider did not find the database file specified in the connection string. At the configured trust level (below High trust level), the SSE provider can not automatically create the database file.

Ive gone through my web.config and there's nothing wrong with my 2 connection strings. It seems godaddy has a problem with using 2 mssql databases simultaneously when 1 is for membership.

Does anyone know a solution or a workaround?

Coltun answered 17/11, 2009 at 1:41 Comment(1)
I FINALLY FOUND A SOLUTION( THANK GOD !) -- After 2 days of googling I figured it out! --Godaddy doesnt allow roles unless you use "LocalSqlServer" as your membership provider conn string -- here are the edits i did to my web.config -- (1)changed the aspnetmem provider conn string to "LocalSqlServer" (2)created the "LocalSqlServer" conn string ...but remember to remove it first i.e <remove name="LocalSqlServer"/>...then <add name... (3) pointed the "LocalSqlServer" conn string to my membership database.Coltun
C
11

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>
Coltun answered 17/11, 2009 at 23:50 Comment(3)
Hi, a million thanks to you for this solution. I was going to sleep after scratching my head, then googled and then got your reply.Saladin
unbelievable... you would think godaddy would make a comment of this in the sql database section. Why on earth would they force the LocalSqlServer name?Crabwise
I did what you suggested @Coltun but I keep getting this 'system cannot find the specified file' exception. I had question here with details of what I tried. Any help or direction would be awesome. #20463619Injector
M
1

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>
Miran answered 17/9, 2012 at 4:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.