Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can't connect to local SQL Server
Message
De
08/01/2008 16:46:56
John Baird
Coatesville, Pennsylvanie, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
01280363
Message ID:
01280375
Vues:
30
>This is nuts! I'm working with VS 2005 with their SQLEXPRESS database for testing purposes. I keep getting errors when I try a connect string and I need help with this silly problem. The code is:
>
>string conns = "server=(local);integrated security=SSPI;database=Northwind";
>SqlConnection conn = new SqlConnection(conns);
>
>I don't know if Northwind is installed, the 14 books I own says it is. Failure message says:
>
>System.Data.SqlClient.SqlException: 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)
>
>If Northwind isn't installed by default, I don't need it, I just want to get going with database connections, actually, what I really want to do is programmatically create my own tables in a database but I can't get there obviously.
>
>I thought it may be security related, I'm local administrator on this computer, this is not on a network domain. This is an out of the box install of Visual Studio 2005.
>
>Please help and thanks in advance.


TCP/IP is not enabled by default. Use the configuration manager, choose protcols for your instance and turn on tcp/ip. That should solve your problem.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform