Solved

SQLEXPRESS Connection String Question

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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

635 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