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?

Tunaki
  • 132,869
  • 46
  • 340
  • 423
The_AlienCoder
  • 577
  • 6
  • 19
  • 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 ...then – The_AlienCoder Nov 17 '09 at 23:38

2 Answers2

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>
Dour High Arch
  • 21,513
  • 29
  • 75
  • 90
The_AlienCoder
  • 577
  • 6
  • 19
  • 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. – pokrate Jan 13 '10 at 21:52
  • 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? – Induster Apr 08 '13 at 05:15
  • I did what you suggested @The_AlienCoder 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. http://stackoverflow.com/questions/20463119/asp-net-forms-the-system-cannot-find-the-file-specified/20463352#20463352 – strider Dec 11 '13 at 03:41
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>
NoviceMe
  • 3,126
  • 11
  • 57
  • 117