error: 26 - error locating server/instance specified - sql-server-2008

This is Arun from Chennai. I have developed my first application in WPF (C#) with VS 2008 & SQL Server 2008. It works fine in my system. After deployment, it wont works in other systems. It shows the following error message.
system.data.sqlclient.sqlexception - a network related or instance specific error occurred while establishing a connection to sql server. the server was not found or was not accessible. verify instance name is correct and sql server is configured to allow remote connections.(provider: sql network interfaces, error: 26 - error locating server/instance specified).
I have gone through the google and done the following steps but no use.
Server Name : ECARE432\SQLEXPRESS
Instance Name : SQLEXPRESS
App.Config have:
<connectionStrings>
<add name="TimeTracker.Properties.Settings.myecareConnectionString" connectionString="Data Source=ECARE432\SQLEXPRESS;Initial Catalog=myecare;Persist Security Info=True;User ID=sa;Password=ecare123#" providerName="System.Data.SqlClient"/>
</connectionStrings>
Visual Studio-->Tools-->Options-->Database Tools-->Data Connections-->
Changed "SQL Server Instance Name" from "sqlexpress" to blank.
Configuration Tools->SQL Server Configuration Manager->SQL Native Client Configration
Aliases->
Alias Name -> ECARE432\SQLEXPRESS,1433
Port Number -> 1433
Protocol -> TCP/IP
Server Name -> ECARE432\SQLEXPRESS
SQL Server Browser is running in my system.
Server Name is correct. No typo mismatch.
Client machine is able to ping my machine.
TCP 1433 and UDP 1434 Exception added to Firewall. Also Turned off the Firewall in both my system and the client system.
Please guide me how to fix this issue.

I have removed the instance name in the connection string. Just I have changed the "Data Source=ECARE432\SQLEXPRESS;" into "Data Source=ECARE432" in the app.config connection string. It works now.

Related

“The server was not found or was not accessible” Error for SQL Server 2008

Error message is like this:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 51 - An instance name was not specified while connecting to a Local Database Runtime. Specify an instance name in the format (localdb)\instance_name.)
And my scenario: IIS and SQL Server 2008 are on the same test workstation, whose firewall is not enabled at all. I don't see any SQL Server log so I can't find any other useful information than the error message above.
I installed SQL Server as default instance (MSSQLSERVER)
My connection string is like this (I am using SQL Server account for authentication):
Server=(localdb); Database=MY_DB_NAME; User ID=MY_USER_ID; Password=MY_PASSWORD
I already verified this user has access to the target database (as owner)
I have gone through some articles on how to track down this problem: I set "allow remote connection" even though IIS and SQL Server are on the same machine. I don't need to set-up firewall.
If you have a standard, unnamed instance, you should use . or (local) (but not (localdb) !) as your server name
Try to use this connection string:
Server=(local); Database=MY_DB_NAME; User ID=MY_USER_ID; Password=MY_PASSWORD

How to sync a remote ASP site with local copy of the site?

I copied an entire ASP site from a remote server to my local machine. I can access the homepage, but once I try to login to the rest of the site, I receive the following error:
"A network-related or instance-specific error occurred while
establishing a connection to SQL Server. The server was not found or
was not accessible. Verify that the instance name is correct and that
SQL Server is configured to allow remote connections. (provider: SQL
Network Interfaces, error: 26 - Error Locating Server/Instance
Specified)"
I set things up to allow for remote connections (enabling TCP/IP and Named Pipes), but is the problem because I'm trying to access a remote database? The connection string in Web.Config is:
<connectionStrings>
<add name="ISBEPI_DEV" connectionString="Data Source=ERI-DB-06\DEVELOPMENT;
Database=ISBEPI_DEV; Initial Catalog=ISBEPI_DEV;Persist Security Info=True;
User ID=Pi_usr; Password =J6$h3Qoz#9Yw;" providerName="System.Data.SqlClient"/>
</connectionStrings>
Any help would be very much appreciated! Please let me know if I can provide more info. Thanks!
Looks like you specified incorrect connection string or you are not allowed to connect to that SQL server. Have you tried to connect to that database from SQL Management Studio or Server Explorer in Visual Studio?

provider named pipes provider error 40 - could not open a connection to sql server 2008

SQL Server Name : ECARE432
Instance Name : SQLEXPRESS
app.config contains:
<connectionStrings>
<add name="TimeTracker.Properties.Settings.myecareConnectionString"
connectionString="Data Source=ECARE432;Initial Catalog=myecare;Persist Security Info=True;User ID=sa;Password=ecare123#"
providerName="System.Data.SqlClient"/>
</connectionStrings>
I have developed my first application in WPF (C#) with VS 2008 & SQL Server 2008. It works fine on my system. After deployment, it doesn't work on other systems.
It shows the following error message.
provider named pipes provider error 40 - could not open a connection to sql server 2008
I have gone through Google and done the following steps but no use.
Configuration Tools -> SQL Server Configuration Manager -> SQL Native Client Configuration Aliases -> Alias Name -> ECARE432,1433, Port Number -> 1433, Protocol -> TCP/IP, Server Name -> ECARE432
TCP/IP is enabled. Protocols -> TCP/IP Properties -> IP1 -> Active - Yes Enabled - Yes, IP Address - My system IP address, TCP Dynamic Ports - Blank, TCP Port - 1433
IP2 -> Active - Yes, Enabled - Yes, IP Address - 127.0.0.1, TCP Dynamic Ports - Blank, TCP Port - 1433
IPALL -> TCP Dynamic Ports - Blank, TCP Port - 1433
SQL Server Browser is running.
Server Name is correct. No typo mismatch.
Client machine is able to ping my machine. (PING ECARE432 is working)
TCP 1433 and UDP 1434 Exception added to Firewall. Also Turned off the Firewall in both my system and the client system.
sqlbrowser.exe is added to the Firewall Exception List.
Allow Remote Connections enabled under Connections in SQL Server Properties.
Visual Studio --> Tools --> Options --> Database Tools --> Data Connections --> Changed "SQL Server Instance Name" from sqlexpress to blank.
Please guide me how to fix this issue.
If you have SQL Server Name: ECARE432 and Instance Name : SQLEXPRESS - then you need to use ECASE432\SQLEXPRESS as the value for your Data Source= in your connection string:
<connectionStrings>
<add name="TimeTracker.Properties.Settings.myecareConnectionString"
connectionString="Data Source=ECARE432\SQLEXPRESS;Initial Catalog=myecare;Persist Security Info=True;User ID=sa;Password=ecare123#"
providerName="System.Data.SqlClient"/>
</connectionStrings>
Along the same lines - if your instance really is called SQLEXPRESS - then why are you doing this??
Visual Studio --> Tools --> Options --> Database Tools --> Data Connections --> Changed "SQL Server Instance Name" from sqlexpress to blank.
Makes no sense at all. If the instance is in fact SQLEXPRESS - let it be!

Login failed for user 'sa'

I am trying to connect to a sql server in my asp.net application. I have given connection string in my web.config as follows :
I am getting following error while running the application :
"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"
If i use remote server's ip address as data source in connection string, I get following error
"Login falied for user 'sa'"
I researched and found some ports need to be opened between the server and my machine, which I got done by network team, still the same issue. How to resolve this ?
You can not directly. you need to have TCP/IP enabled and configured the TCP/IP Ports on sql server configuration manager at remote server.
you need to have TCP/IP connectivity .Just launch it, enter the DNS host name or IP address in the Server Name' box and hit Connect. The hosting company needs to have enabling TCP/IP on your SQL Server instance, and them providing you with secure access to the IP address that instance is running on.
Most administrators do not allow direct access to the SQL Server from outside the firewall. In that case, if you can connect to the host over VPN then you should be able to connect directly to the server with Enterprise Manager or SQL Management Studio.
Please go through it Configurations-Remote-Server
Are you porting code from Hypersonic or H2? If so, the username sa won't work.

SQL Server Express - Remote Connection continues to fail

I have been unable to configure my SQL Server 2008 Express to allow remote connections. I followed the instructions from this guide: http://www.linglom.com/2009/03/28/enable-remote-connection-on-sql-server-2008-express/ .
I am still getting the following error:
Cannot connect to 00.00.00.000
Additional information:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
(Provider: Named Pipes Provider, error 40 - Could not open a connection to SQL Server) ( Microsoft SQL Server, Error: 3)
I also configured the firewall as defined in http://blog.sqlauthority.com/2009/05/21/sql-server-fix-error-provider-named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server-microsoft-sql-server-error/ . As a test I even turned off the firewall, but nothing changed, so it is not the issue.
Update under server name, it only says the IP address. Do I need something more?
In the Server name field of Connect to Server, I had myipaddress. I changed it to myipaddress\SQLEXPRESS and it works.
In addition, once this was working without the firewall I applied settings as defined in http://www.sevenforums.com/system-security/58817-remote-access-sql-server-express-2008-windows-7-a.html to make the connection work with the firewall turned on.
Do you have sysadmin rights in sql express? It may be that your user account doesn't have the necessary permissions. There is a script on codeplex that will add you logged on account as a sysadmin.