Solved

SQLEXPRESS Connection String Question

Posted on 2007-03-18
3
598 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
3 Comments
 
LVL 6

Accepted Solution

by:
sara110 earned 250 total points
Comment Utility
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
Comment Utility
hi,
sara110's post would solve your problem.
0
 
LVL 16

Expert Comment

by:rboyd56
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
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.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now