如何使用SQL查询连接两台计算机? [英] how to connect two computers using SQL queries?

查看:101
本文介绍了如何使用SQL查询连接两台计算机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尊敬的先生,
我有问题,
使用c#.net创建的应用程序和数据库驻留在另一台计算机中
现在我想执行类似的操作,我想通过应用程序添加数据. 服务器计算机上没有Internet连接,
和两台计算机通过LAN连接..
所以请尽快解决我的问题
谢谢u

Respected sir,
I have problem regarding,
My application created using c#.net and my database resides in another computer
now i wnt to perform like,i wnt to add data through the application..
there is no internet connectivity on server computer,,,
and two computers are connected through LAN..
so plz solve my problem,,as soon as possible
thank u

推荐答案

您需要做的就是通过LAN建立连接.如果使用的是SQL Server,请尝试使用服务器资源管理器"窗格在VS中建立连接:
1)打开服务器资源管理器.
2)右键点击数据连接"并选择添加连接"
3)在随后的对话框中,选择您的数据源和数据库,指定安全信息,然后按测试连接".按钮.
4)连接正常后,按确定"
5)在服务器资源管理器"窗格中突出显示您的数据库,然后查看属性"窗格.将显示一个连接字符串的工作示例,您可以将其复制并粘贴到您的应用程序或配置文件中.
All you need to do is establish a connection via the LAN. If you are using SQL server, then try setting up a connection in VS with the Server Explorer pane:
1) Open Server Explorer.
2) Right click "Data connections" and select "Add connection"
3) In the dialog that follows, select your DataSource, and database, specify the security info, and press the "Test connection" button.
4) When the connection works, press "OK"
5) Highlight your database in the Server Explorer pane, and look at the Properties pane. A working example of the connection string will be shown, which you can copy and paste into your app or config file.



您只需要更改连接字符串即可.
对于连接字符串转到此链接-
连接字符串 [ ^ ]
Hi,
You just have to change the connection string.
For connection string Go to this link -
connection strings[^]


这篇关于如何使用SQL查询连接两台计算机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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