my program cannot connect to SQL server 2005

Answered my program cannot connect to SQL server 2005

  • Thursday, March 15, 2012 11:31 AM
     
     
    i have an application that connect to an SQL server 2005 database , it is working normally on a windows xp , but i installed on a windows 7 64 bit version . when i try to connect from the application its giving this 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 am able to connect from the Management studio 

All Replies

  • Thursday, March 15, 2012 11:49 AM
    Answerer
     
     
    Firewall? Add 1433 port... Make sure that MS Sql service is running,make sure TCP protocol is enabled and etc.

    Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/

  • Thursday, March 15, 2012 11:59 AM
     
     
    Firewall is turned off ,the service is running and the TCP protocol is enabled .....
  • Thursday, March 15, 2012 12:39 PM
     
     

    check if the named pipes are enabled???

  • Thursday, March 15, 2012 5:05 PM
     
     
    go to surface area configuration of your sql server and enable and tcp/ip port

    nishin

  • Thursday, March 15, 2012 8:16 PM
     
     
    the named pipes are enabled also the tcp/ip is enabled ......
  • Friday, March 16, 2012 6:12 AM
     
     Answered

    Go to SQL Server Surface Area Configuration and click Surface Area Configuration for Services and Connections and

    On the Surface Area Configuration for Services and Connections page, expand Database Engine, click Remote Connections, click Local and remote connections, click the appropriate protocol to enable for your environment, and then click Apply.

    On the Surface Area Configuration for Services and Connections page, expand Database Engine, click Service, click Stop, wait until the MSSQLSERVER service stops, and then click Start to restart the MSSQLSERVER service.

    i faced the same problem but it was on windows xp only and it helped me to resolve it.please try

    http://support.microsoft.com/kb/914277


    nishin

  • Friday, March 16, 2012 7:00 AM
     
     
    I tried all these steps before posting in this thread , i think my problem is because i have a windows 7 with 64 bit , because i have a machine with the same configuration but having windows xp and everything is workin niceley ....any other suggestions ?