I'm having trouble using one of my everyday .net programs to connect to our new sql08 server. I have a sql2k and a sql2k5 server that never give me grief with this program. Whenever I try to connect to one of the databases I get 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
I've tried it using my normal connectionstring that works in 2k and 2k5. I tried it with the IP of the sql server, then I tried using the named instance of the server or what I THINK is the named instance...
I've tried odd combos of "myserver\instance" and all the rest. I tried using the standard connectionstrings from: http://www.connectionstrings.com/sql-server-2008
as well. Still the same error. My router has a firewall rule to allow port 1432-1434 through to my server. The sql server is also our webserver so I'm sure there is some permissions issue that I'm not able to find. The program I'm testing is a vb.net web app. Here is the sub for db connect:
Sub Button1_click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ConnectionString As String = "workstation id=""me"";packet size=4096;user id=user1;password=password;data source=""DA-SQL03\SQL03"";persist security info=False;initial catalog=customers"
'sql08 connectionstring from link above - Dim ConnectionString As String = "Server=DA-SQL03\SQL03;Database=customers;User ID=user1;Password=password;Trusted_Connection=False;"
Dim conn As New SqlConnection(ConnectionString)
Dim query As String = "SELECT * FROM login WHERE username = @username AND password = @password AND clientid = @clientid"
Dim newcommand As New SqlCommand(query, conn)
newcommand.Connection = conn