Solved

SQLEXPRESS Connection String Question

Posted on 2007-03-18
3
608 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
A quick step-by-step overview of installing and configuring Carbonite Server Backup.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

738 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