Still More Database Connection Problems

  • Thread starter Thread starter Jonathan Wood
  • Start date Start date
J

Jonathan Wood

I'm going through several books on ASP.NET database programming. They all
make it look so easy. But it just never seems to work for me.

So I created a new ASP.NET application.

I right click on Data Connections in Server Explorer and select 'Create New
SQL Server Database...'

The Server name box is empty and all the online help tells me about this box
and what I can enter here is "Shows the name of the server for this
connection. To choose a different server, select one from the drop-down list
or type the server name into the text box." So I entered localhost. I also
tried entering local.

I enter a name for my database, test1.

After a considerable pause, I get the 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: Named Pipes
Provider, error: 40 - Could not open a connection to SQL Server)"

I'm running as an administrator on Windows Vista with SQL Server Express
installed. I had the same problems previously on a different computer
running XP.

Is there anyone who can tell me why I cannot do basic database connection?
 
Looks like I got help on this elsewhere. The answer is to use .\SQLEXPRESS
as the server.
 
Hello,

localhost\SQLExpress should do the trick as well.

I think SQL Server Express only has by default enabled "Shared Memory",
maybe if you type the name of your machine it thinks it's a remote computer
and tries to connect via Named Pipes or TCP /IP (you can see if this is
enabled in SQL Server Configuration >> Services Running).

Take care as well using windows account for connecting on ASP .net (I woul
rather use custom login from SQL Server).

Good Luck
Braulio

/// ------------------------------
/// Braulio Diez
///
/// http://www.tipsdotnet.com
/// ------------------------------
 
Back
Top