View Single Post
  #1 (permalink)  
Old 09-10-2006, 01:10
eUKShane eUKShane is offline
Senior System Administrator
 
Join Date: Oct 2006
Posts: 145
Thumbs up Error connecting to sql 2005 express

POST APPLIES TO : WINDOWS (sql 2005 express)

1) Please make sure you have Initial Catalog=xxxxx in your connection string. You may sometimes receive an error regarding the log file. You can simply rename or remove the old log file, the application will attempt to create a new one. If it doesn't work, please try the following connection string as well:

2) Make sure you grant the folder "app_data" with read/write/execute/modify (or delete) permission on the Network Service user.

3) Make sure you only upload the .mdf file into the "app_data" folder (Do not upload .ldf file or you will receive errors saying database with the same name exists in the server).

Please make sure your connection string in your web.config is like below

Quote:
[add name="LocalSqlServer" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|\ASPNETDB.MDF;user instance=true;Integrated Security=True;Initial Catalog=ASPNETDB;" providerName="System.Data.SqlClient" /]
(If you are using a deployment project then make sure you enable web.config section replacement and put the connectionStrings section in there, like this: connectionStrings=connectionStrings.config


------------------------
Best Regards,
UKShane
http://www.eukhost.com
Reply With Quote