L’Express maledetto

 

 

Cercavo di accedere ad un database SQL montato su di un SQL Express 2008 installato su localhost con una connection string tipo:

“Data Source=localhost;User ID=user;Password=password;persist security info=False;” providerName=”System.Data.SqlClient”

la risposta del server web:

An error has occurred while establishing a connection to the server.

(provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 5)

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) (Microsoft SQL Server, Error: 1326)

La soluzione è indicare l’istanza completa come Data Source, quindi localhost\SQLExpress

Ci ho investito solo un’ora di improperi…….

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.