connection to sql 2005 failed

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amar elzaman
    New Member
    • Aug 2009
    • 4

    connection to sql 2005 failed

    hello every body

    i did an application with c# to connect to sql server and it worked well on my local machine (to connect to my sql server 2005 on my computer),

    but now i want to connect to a remote sql server 2005 which is on another computer, but it failed to connect through the application and even the my sql server management studio express 2005 and i failed to connect through visual studio 2008 servers part.

    oh i went banana, i did all what i found in all posts i read.

    -i made sure that the firewall give authority to my application & sql server to connect without blocking,
    -added the port to the firewall
    -added the /sqlexpress to server string
    -added /sqlexpress,port no to the server string
    -used the connection string the provider gave it to me it’s likeSqlConnection (.NET):
    Data Source=db_name. db.6236289.host edresource.com; Initial Catalog=db_name ; User ID=user_id; Password=’your password’;
    But also it is useless

    -quite sure that my sql server tcp/ip and named pipeare enabled.

    oh nooo, i don’t know what can i do???? please any one help me.

    hint : the only way allowed me to connect to that sql server was the “database publishing wizard” when i tried to script my local db and to put it on the remote server, it worked well and created the tables on the remote server,
    But when i tried to make the oppsite (to script the db that is remotely it failed and i get the same error)
    Error details:
    “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: TCP Provider, error: 0 – No such host is known.) (.Net SqlClient Data Provider)”



    ------------
    there is something i made now to try

    i made a web page connect to that sql server with the same connection string and it worked when i uploaded to my website,

    But

    locally it doesn’t work, may be that means that the problem in my computer especially that my sql management studio couldn’t connect also to that remote server?!!!,

    HINT : my application is a “windows forms application”

    please please help me, it’s urgently.
  • wizardry
    New Member
    • Jan 2009
    • 201

    #2
    check with your server / host. typically you cannot run your development, on your production server. two separate instances.

    u need direct access to the db server. which means your not able to connect.

    you'll need to contact your host provider.

    Comment

    • amar elzaman
      New Member
      • Aug 2009
      • 4

      #3
      i tried but useless, they couldn't help me.

      Comment

      • Aimee Bailey
        Recognized Expert New Member
        • Apr 2010
        • 197

        #4
        This maybe a silly question, but are you using SQL Server 2005, or SQL Server Express 2005?

        The usual cause of this is that the basic setup allows you to connect on the local system using your windows credentials, but trying from another computer will fail because you would need the same credentials to access that type of account. There exists a work around, but what it involves is you enabling user accounts and allowing remote connections, after 2 mins of google, I found a tutorial that will most likely help:

        By default, SQL Server 2005 Express doesn’t allow remote connection. This post shows how to enable remote connection to SQL Server 2005 Express


        All the best :)

        Aimee.

        Comment

        Working...