SQL Connection

  • Thread starter Thread starter Guest
  • Start date Start date
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!!!
 
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.

..........
 
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
 
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.
 
Back
Top