Last post Jul 01, 2010 06:41 PM by softwareluv
Aug 09, 2009 01:39 AM|Kriswd40|LINK
I have setup an instance of the Classified Starter kit locally on my PC that works flawlessly. It is setup to use the SQLExpress database files that reside in the App_Data directory.
When I copy the entire project to my web server though, I get the following error:
"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
(provider: Shared Memory Provider, error: 40 - Could not open a connection to SQL Server) "
In my web.config file, the connection to the database is setup like so:
<add name="classifiedsConnection" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\classifiedsdb.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
Is it not possible to use the included SQLExpress databases when copied to a web server (IIS)? Or is there some other step I'm missing to set this up???
Aug 09, 2009 09:26 AM|nomercy007|LINK
means that the sqlserver express is installed locally on the server.
If not then you have to modify your connection string accordingly.
check this link:
Aug 09, 2009 01:30 PM|Kriswd40|LINK
I suspect it's not installed locally... I was hoping that I could used the file in app data and run that.
I'm confused though... can I tell a regular instance of SQL Server to use the CLASSIFIEDSDB.mdf file in app_data??? Otherwise, how do I setup those tables within the instance of SQL server I already have setup?
Aug 11, 2009 04:50 AM|nomercy007|LINK
In SQL Serverl Management Studio, You need to "attach" the database file. Then in your application you configure the connectionstring accordingly.
Aug 11, 2009 11:31 AM|SNandra|LINK
How can you attach it without the log file?
I am using sql server 2008
Aug 18, 2009 05:16 AM|nomercy007|LINK
Jun 30, 2010 11:57 AM|softwareluv|LINK
How can i do it on web hosting? it doesnt allow me to attach file and i dont know the exact location of my file on server as it is shared hosting.
Jul 01, 2010 06:41 PM|softwareluv|LINK
Any experts to help please?