试试
连接中的Server=远程数据库的ip

解决方案 »

  1.   

    server=IP;User ID=qq;Password=qq;database=aa;Connection Reset=FALSE
      

  2.   

    "server=hostname; uid=sa; pwd=; database=data"
      

  3.   

    server=www.sohu.com;uid=sa;pwd=;database=book;Trusted_Connection=yes
    你用IP连接时,要注意你的DNS的设置和防火墙的设置,DNS要和远端的保持一致,否则会有:SQL Server不存在或访问被拒绝.3
    string myConnectString = "server=210.#.#.#(IP地址);database=ap;uid=ap;pwd=re";
    210.#.#.#(IP地址)应该为远程服务器名。
      

  4.   

    http://expert.csdn.net/Expert/topic/1063/1063931.xml?temp=.6824304
      

  5.   

    If connection to a remote server (via IP address):oSQLConn.ConnectionString = "Network Library=DBMSSOCN;" & _
                                "Data Source=xxx.xxx.xxx.xxx,1433;" & _
                                "Initial Catalog=mySQLServerDBName;" & _
                                "User ID=myUsername;" & _
                                "Password=myPassword"
    Where: 
    - "Network Library=DBMSSOCN" tells SqlConnection to use TCP/IP Q238949
    - xxx.xxx.xxx.xxx is an IP address.  
    - 1433 is the default port number for SQL Server.  Q269882 and Q287932
    - You can also add "Encrypt=yes" for encryption