Connection Problems

  • Good day i have come across a very interesting problem today regarding our Sql server 2008 server , we are currently running a default instance as well a a 2008 R2 instance on the same server. I can connect to the R2 instance just fine with SSMS so i thought well the problem is my connection string. I then opened visual studio and browsing to the instance with the server explorer worked just fine. So i copied the connection string to my program ...... Does not work.

    Howerver when i replace the server name with the ip address of the server it works just fine???

    How is SSMS able to translate the server name but wen i specify the connection string in a program it fails

  • Does the program run on the same computer as SSMS and Visual Studio? Do you have an alias set up in SSMS that your program would not be able to use? Is there a firewall between your program and the database server? What is the exact error message that you get? Is SQL Server Browser running?

    John

  • We could do with seeing an example of the connection string and knowing whether you are using trusted (windows) authentication of a SQL login.

    With trusted authentication you should not be supplying a user name or password.

    For yourself, you can also check the SQL error log to verify the connection attempt is being made and that there has been a failed login attempt.

  • Thanks for the quick response guys here is the connection string, I have sql server running in mixed mode. And yes its on the same computer

    Here is the connection string

    "Data Source=hostname\R2;Initial Catalog=dbname;Persist Security Info=True;User ID=username;Password=***********"

    The error im getting is

    Specified SQL server not found hostname\R2

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply