Wednesday, February 15, 2012

Error while establishing connection with sql server 2005 express

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]

the above was my error and i got a solution from y71chen as below

Problem solved...it turn out that in ASP.NET SQL server setup wizard when it asks for server name, I have to specifiy theinstance name as well as the server name when MS refer to "Server Name" they really mean "Server Instance Name") eg if your server was named 'bigturnip' then you need to specify 'bigturnip\sqlexpress' (where sqlexpress is the instance name - this one just happens to be the default used by SQL Server 2005 SQLExpress). By default the server name was entered as merely "bigturnip" but after i added "\sqlexpress", then everything worked. If anyone else is having this remote connection problem and when they did select remote connection and still does not work this is the way to solve the problem....

but my doubt is do i want to install my software again for specifying the instance name along with the server name or where can i go and specify the instance name.

regards

kalyan

Which software do you want to re-install? Are you referring to VS2005? I remember that there is not step during the installtion of VS2005 that allows you to specify the instance name for SQL Express; and the instance name is default to SQLExpress, while the server name is your computer name which can not be assigned other string.|||

i had the same problem as you describe above but still when i added \sqlexpress to my connection string, i got the error below. Help please.

Cannot open database "mydatabase.mdf" requested by the login. The login failed.
Login failed for user 'domain\myusername'.

No comments:

Post a Comment