Solved

SQLEXPRESS Connection String Question

Posted on 2007-03-18
3
606 Views
Last Modified: 2012-05-05
I am having a problem with my connection strings to my SQLEXPRESS database.

This connection sting works great on the development machine:

<add name="SuppliersConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\DBname.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>

I upload the files (ASP.NET 2.0 web.config) to my web hosting company and I get this error when I try to open a page that references this string:

An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

My hosting company just wants me to take the SQLEXPRESS databases and upgrade them and put them on the SQL Server 2005 database that comes with the hosting plan. I would rather keep them separate.

The hosting plan comes with this (example) info:

IP address: 123.123.123.123
SQL Server 2005 database server name: SQL2005.webhostingco.com

Of course, I have a user name and password.

How can I fix this? What is the correct connection string, if there is one?

Thanks for the help!!
0
Comment
Question by:Cyberzones
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 6

Accepted Solution

by:
sara110 earned 250 total points
ID: 18746265
like sql server 2000 you could use same method to connect to your sql server express in remote machine example
<add key="SuppliersConnectionString" value="server=123.123.123.123;initial catalog=YourDBName;User ID=YourUserName;password=YourPassword">
            </add>
0
 
LVL 6

Expert Comment

by:Niraj_Singh
ID: 18746501
hi,
sara110's post would solve your problem.
0
 
LVL 16

Expert Comment

by:rboyd56
ID: 18747844
Since you are using SQLExpress, make sure that the hosting company has enabled has enabled TCP/IP for the instance of SQLExpress. By default it is not enabled so it will need to be enabled before remote users can connect.
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Learn about cloud computing and its benefits for small business owners.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question