0

I have developed a software for remind for my costumer what he want to do in future.

I can use it in my own laptop but when I create a setup file and install it in customer laptop it has some errors. when i use this software in my own laptop my connection string is

server=localhost;database=Reminderdatabase;Trusted_Connection=true;

and when I want to use it in customer laptop I use this connection string

@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ReminderDatabase.mdf;Integrated Security=True;user instance=true;

and I installed SQL Server 2008 R2 on his laptop and .net framework 4.0.

Now when I want to connect to database an error occurred that say 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 instance name is correct and SQL Server is configured to allow remote connections.(provider: SQL Network Interfaces, error 26 - Error Locating Server/Instance Specified).

This confused me. I looked for it in more than 50 links but not good answer it gave to me. I do not have more time to learn and search for user instance or things like that and understand it. Please tell me what I must do to solve this error.

Thank you so much for your helping

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
starbug
  • 9
  • 1
  • 8
  • What **edition** (Express, Standard, Web, Enterprise) did you install on your customer's laptop, and what **instance name** did you choose when installing (if any) ?? – marc_s Aug 22 '14 at 10:10
  • i installed sql express 2008 R2 on customer laptop. i installed default instance because one user use this software. – starbug Aug 22 '14 at 10:16

2 Answers2

0

try with this

 @"Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\ReminderDatabase.mdf;Integrated Security=True;user instance=true;
  • http://stackoverflow.com/questions/13754563/sql-network-interfaces-error-26-error-locating-server-instance-specified –  Aug 22 '14 at 10:42
  • Go through the above link –  Aug 22 '14 at 10:42
  • in the above link we can see sqlexpress and we can change setting of it.but i can not see sqlexpress in my customer laptop. – starbug Aug 22 '14 at 10:56
  • On the Start menu, right-click My Computer, and then click Manage. In Computer Management, expand Services and Applications, and then click Services. In the list of services, double-click SQL Server Browser. In the SQL Server Browser Properties window, click Start or Stop. When the service starts or stops, click OK. –  Aug 22 '14 at 11:13
  • @Midhum M: still that error appear.can you please explain me if i install sqlexpress r2 in customer laptop what i must do to do not see this error. and what things i must check such as connection string or ports or other things that i do not know. – starbug Aug 22 '14 at 12:39
  • thanks. i reinstalled the sql express 2008 R2 and in instance section i choosed named instance instead of default instance and it worked for me. thank you and others. – starbug Aug 22 '14 at 15:31
0

Server side:

Make sure that you have enabled remote connections on the instance (RELYONDB) of SQL Server.
Make sure that firewall is OFF.
Make sure that firewall has been configured to make an exception for SQLBROWSER.EXE and SQLSERVR.EXE in server computer.

Client side:

Make sure that you have typed correct server computer name and instance name
Make sure that server machine is reachable. Check you are able to ping the server.
Make sure that you are able to access the shared folder of remote server.
Make sure that you are able to connect SQL Server using the Telnet command.

Workaround 1:

Enable Using both TCP/IP and Named Pipes:

All programs | Microsoft SQL Server 2005| Configuration Tools | SQL Server Surface Area Configuration | Configuration for Services and Connections | Remote Connections, choose Local and Remote Connections |Enable Using both TCP/IP and Named Pipes.

Restart SQL Server RELYONDB & SQL Server Browser service.

Workaround 2:

Enable Using both TCP/IP and Named Pipes:

All programs | Microsoft SQL Server 2005| Configuration Tools | SQL Server Configuration Manager| SQL Server Network configuration| Right Click “Named Pipes” & Click Enable > Right Click “TCP\IP” & Click Enable

Restart SQL Server RELYONDB and SQL Server Browser service.

Workaround 3:

Click Start | Run | type firewall.cpl | Switch Off | Click OK.

or

Create an exception in windows firewall.

Add TCP port or sqlservr.exe to Firewall exception list, either add “..\Binn\sqlsevr.exe” or add port.

Add Sql Browser service to Firewall exception list, you can either add program ” C:\Program Files\Microsoft SQL Server\90\Shared\sqlbrowser.exe” or add UDP port 1434

Workaround 4: [Client side]

Check whether PINGing is happening in both client and server systems

Click Start | Run | type cmd| Click OK

Open command prompt as Run as Administrator | Type PING

Workaround 5: [Client side]

Resolve DNS cache:

Click Start | Run | type cmd| Click OK

Open command prompt as Run as Administrator | type ipconfig /flushdns

Workaround 6: [Client side]

Give server IP address in connection string instead of hostname.

Mazz
  • 1