View Single Post
  #1 (permalink)  
Old 21-06-2007, 21:00
rich_ex rich_ex is offline
new member
 
Join Date: Jun 2007
Posts: 1
Default Connecting website to MS SQL Express db

Hi everyone,

I have been creating a website hosting over the last few weeks, and have just bought my hosting package etc from here.

Basically, I've used Visual Studio Express with the built in SQL Server Express db hooked on with stored procs and tables.

Locally, this is all running fine - but I'm have a few issues on the remote website hosting. I have put all the website hosting files in the 'httpdocs' folder, and the SQL Server db is under this structure within an 'App_Data' folder

On loading the website hosting I was getting :

Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.


After looking through a few forums I changed my connection string in the web config, so that User Instance = False, but now get an even odder error:


CREATE DATABASE permission denied in database 'master'.
An attempt to attach an auto-named database for file D:\Inetpub\vhost\#####.co.uk\httpdocs\App_Data\Web DB.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: CREATE DATABASE permission denied in database 'master'.
An attempt to attach an auto-named database for file D:\Inetpub\vhost\#####.co.uk\httpdocs\App_Data\Web DB.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

Can anyone help?
Many thanks,
Rich

P.S. if useful, my web config connection string is:
connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=False;AttachDBFilename=|DataDirectory|Web DB.mdf"
providerName="System.Data.SqlClient"

Reply With Quote