i have a problem . please help me

H

hamid hashemi

Hello,
I am writing ASP.NET application using SQL Server 2005 Express Edition.
my connection string is :
"Data
Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\DB.mdf;Integrated
Security=True;Connect Timeout=30;User Instance=True";


I used connection strings syntax from www.connectionstrings.com.
this app work in IIS very well
but when i upload it on the host i reiceve this error :
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)

please help me if you can ?
 
N

Norman Yuan

1. Do you know what is Sql Server Express' USER INSTANCE? If not necessary
study is due.
2. Does your host use SQL Server Express or other version SQL Server
(Standard Edition or upper)? USER INSTANCE is only available for SQL Server
Express.
3. Do you need to use USER INSTANCE in a web application? Why?

Unless your host use SQL Server Express (unlikely if it is comnercial hosing
services provider), you would focus your study on:

1. forget USER INSTANCE and study on basic SQL Server security: configure
SQL Server logins, database users;
2. Configure ASP.NET security, so that you know which user account is
requyired to run the ASP.NET app, hence give needed access permission to SQL
Server/database to that user account, or configure ASP.NET to run under
given user account. If the SQL Server and your web app are on different
computer, you need to staudy a bit more on this topic.
3. change your connection string so that you do not attach/detach datatbase
to SQL Server each time the app connects to SQL Server Express. I mean, even
the host uses SQL Server Express, you probably do not need to use USER
INSTANCE for your web application, the database should be attached to the
SQL Server at beginning what you setup the website.
 
R

Rad [Visual C# MVP]

Hello,
I am writing ASP.NET application using SQL Server 2005 Express Edition.
my connection string is :
"Data
Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\DB.mdf;Integrated
Security=True;Connect Timeout=30;User Instance=True";


I used connection strings syntax from www.connectionstrings.com.
this app work in IIS very well
but when i upload it on the host i reiceve this error :
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)

please help me if you can ?

Does the web host have SQL Express installed?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top