Click here to Skip to main content
15,891,812 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi! I have a problem with my queuing system. Whenever other computers, other than the server, runs the program, it displays an error "...error 26 - Error locating server/instance specified." I don't have any idea how other computers can't find the server. Is my connection string wrong? Thanks for the help!

I'm currently using VS2012 and SQL Server 2014 as my server.
Below is my connection string code block:

What I have tried:

Try
           Dim sqlconn As New SqlConnection
           Dim sqlquery As New SqlCommand
           Dim connString As String
           connString = "Server=MISKRISTIAN-PC\HMO_OPD;Database=HMO_OPD_QUEUE;Trusted_Connection=True;"
           sqlconn.ConnectionString = connString
           sqlquery.Connection = sqlconn
           sqlconn.Open()
           sqlquery.CommandText = "INSERT INTO Retlane([Number],[Tick_Date],[Tick_Time])VALUES(@Number, @Tick_Date,@Tick_Time)"
           sqlquery.Parameters.AddWithValue("@Number", NumRet.Text)
           sqlquery.Parameters.AddWithValue("@Tick_Date", Queue.Label3.Text)
           sqlquery.Parameters.AddWithValue("@Tick_Time", Queue.Label21.Text)
           sqlquery.ExecuteNonQuery()
           sqlconn.Close()
       Catch ex As Exception
           MessageBox.Show(ex.Message)
       End Try
Posted
Updated 16-Nov-17 22:36pm

1 solution

Start here: Simple SQL Connection String Creation[^] once windows has a workign connection for you, us that string.
If Windows can't establish a connection, you need to look at the network and instance to ensure that it accepts remote connections, and that the appropriate ports are unblocked on any local firewalls.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900