SQL Connection

G

Guest

I connect to my SQL 2005 Express database via VS2005 via the Server Exlporer.
I copy the connection statement from the connection string property when I
right click on that database connection in Server Explorer.

When I use this connection string in my ASP.Net code, I get the following
error when I attempt to connect....

"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)"

Is there some setting that I have to make to SQL Express 2005 in order to
connect to my Database via ASP.Net? Do I need to set up a dummy account
which my ASP.Net aplication will use to perform updates to my SQL Database?

Thanks in advance for your assistance!!!
 
S

sloan

That error is kinda like

"You car is making a funny noise, it ~might be the brakes".

........

A. Are you connecting to a remote db? If so, you need to go to Start /
Programs / Sql Server 2005 / Surface Configuration (or something like that).

B. If you are NOT connecting to a remote db, then its some kind of
connection string issue. Aka "You car is making a funny noise, it ~might be
the brakes", but the real issue is that your transmission is not working.
Aka, the message you're getting is not the real cause of the problem.

..........
 
D

David R. Longnecker

Nothing specific, but you do need the .\SQLEXPRESS in the data source property:

Here's an example:

<add name="NorthWindConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\NORTHWND.MDF;Integrated
Security=True;User Instance=True"

HTH.

-dl
 
N

Norman Yuan

If it is ASP.NET application, why use "User Instance"? depending on which
user account is configured to run the ASP.NET app, it may not be possible to
use User Instance, for exaple, if the ASP.NET is run by "Network Service"
account (on Win2003).

So the answer to OP is to do due study on SQL Server security and ASP.NET
app security configuration.
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top