I have SQL Server 2005 Installed on a test Windows XP Pro SP2 (with firewall ports opened, Named Pipess / TCP enabled). I have SQL Management Studio 2005 and Visual Studio 2005 installed on my pc. I am writing an application that connects to the database in Visual Basic .Net.
I am using the following code to connect to the sql database server:
tial Catalog=CDH;Persist Security Info=True;User ID=XXXXX;Password=XXXXX"
The UserID and Password are correct. I can login, using these same credentials in management studio. However, I get the error when I try to access the SQL DB from my application:
SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified
I can also ping the pc with the SQL Database just fine (just to further assure it's not a generic network issue).
On top of all this, this code/application worked just fine before we switched from a workgroup to a domain.
So, what am I missing?
Public Function Open() As Boolean
If Not Me.ConnPath = String.Empty Then
'If Me.Conn.State.Closed Then 'Create connection if non-existant
Conn = New SqlConnection(ConnPath)
MessageBox.Show("The connection could not be opened because the application did not set the SQL connection path before trying to open a connection to the SQL Database.", "SQL Connection Failed", MessageBoxButtons.OK, MessageBoxIcon.Error)
Catch ex As Exception
MessageBox.Show("Unable to open a connection to the SQL database." & vbCrLf & "Detail:" & vbCrLf & ex.ToString, "SQL Connection Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
'Where ConnPath = "Data Source=SQLTEST\SQLTEST;Initial Catalog=CDH;Persist Security Info=True;User ID=XXXXX;Password=XXXXX"