sql connection

I haved installed SQL Servver 2005. I am trying to make a connection to it in VS.NET. I get a error that says "Can notr make a connection to sql server. This may be due to the fact you have remote connections turned off. I change this settings and still have the same problem. Do you know why

Cisco



Answer this question

sql connection

  • windark

    I've got the same difficulty, though it works great on my machine. My initial relative post can be found:
    http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=385524&SiteID=1

    After debugging and stepping through time and again I found I did carry thecorrect string for connection..atleast, as far as I know.

    I ensured this by using:

    System.Environment.MachineName

    as a method to gain the host computer name. As SQL Express installs with the defualt instance name being SQLEXPRESS I added the two together to make my server connection string:


    System.Environment.MachineName
    returned "Neil" --my computer name
    thus:

    Neil\SQLEXPRESS

    was the resulting string for connection. The same code was used for installation on 2 other machines and the result would be the same error you are getting.

  • Wolf Schmidt

    I got exact same error, and remote connections were enabled for my server too. This error message was a bit misleading, what actually happened in my case was I had installed SQL Server 2005 on a named instance e.g. mysvr\dev01 and in connection string I used only mysvr. Please check if yours is a similar case and if you are missing out on instance name in the connection string.
  • George A. roberson

    That was the problem now it works fine.

    Thank you

    Cisco


  • sql connection