如何连接到远程计算机上存储的数据库 [英] How to connect to database stored on a Remote computer

查看:96
本文介绍了如何连接到远程计算机上存储的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个简单的应用程序,它将数据插入数据库.该数据库位于远程计算机上.
但是,这台装有SQL的机器(装有SQL).我的电脑(有应用程序)可以找到这台机器的
通过使用代码的IP地址.到现在为止一切都还好.
现在,当我尝试将数据插入数据库时​​,出现错误找不到此类主机".这些机器是通过
连接的 相同的路由器,所以我需要问我每次尝试插入数据时是否都已打开Internet或还有其他方法
解决这个问题?


注意:它不是Web应用程序.它是一个简单的C#应用​​程序.

请帮忙

谢谢和问候
Ajinkya

Hey people,

I have a simple application which inserts data into database. The database is located on a remote machine.
However this machine(which has SQL) has a router installed. My pc(which has application) can find this machine''s
IP address by using a code. Everything is okay till this stage.
Now when I try to insert data into DB it gives me error "No Such Host Found". As these machines are connected through
same router, so i need to ask that do i have switch on internet everytime I try to insert data Or is there any other way
around this problem?


NOTE : Its not a Web Application. Its a simple C# application.

Please help

Thanks and regards
Ajinkya

推荐答案

尝试使用连接字符串中的 Security = false 进行尝试
Try one with making Security=false in the connection string


有防火墙问题或连接字符串.您可以尝试禁用防火墙,以查看是否是引起问题的原因.

与数据库的连接基本上只是tcp/ip流量,因此,如果您的服务器和客户端都在本地网络中,则Internet与此无关.还要注意,根据操作系统版本的不同,服务器和客户端的两端可能都有防火墙.

检查连接字符串是否正确指向正确的服务器,正确的实例名称(如果有)以及具有corerct身份验证.您可以使用 http://www.connectionstrings.com/ [
Could you be having a firewall issue or connection string. You can try disabling the firewall to see if it is causing the problem.

The connection to the database is basically just tcp/ip traffic so if both of your server and client are in the local network, internet doesn''t have anything to do with this. Also note that you may have firewall on both sides, at the server and at the client, depending on the OS versions.

Check the connection string that it''s properly pointing to the correct server, correct instance name (if any) and with corerct authentication. You can check the connection string using http://www.connectionstrings.com/[^]


这篇关于如何连接到远程计算机上存储的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆