Login control wont work when uploaded to host

Mondeo

Centurion
Joined
Nov 10, 2006
Messages
128
Location
Sunny Lancashire
Hi,

I've built a login system on my site using the wizard, its created a database called ASPNETDB.MDF in the /App_Data folder and it all works fine locally.

I've copied it all up to the host and now it doesn't work.

I get the error: provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified

What do I need to do, I presume its becuase in the connection string its got an entry for AttachDBFilename= a path on my local machine.

How can I change this path, its all greyed out in the properties window and I cant find any mention of it in the web.config

Thanks
 
In your web.config try adding the following to your configuration section
Code:
<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|aspnetdb.mdf" />
</connectionStrings>
If you already have a connectionStrings section then try adding those entries to your existing section.

That should point the built in security model to the correct place.
 
Back
Top