如何让我的所有电脑连接到服务器中的SQL数据库? [英] How do i let all my pc's connect to a sql database in server?

查看:117
本文介绍了如何让我的所有电脑连接到服务器中的SQL数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个我希望在vb.net中开发一个数据库应用程序。我想要的是我希望我的所有计算机能够连接到将存储在服务器上的
sql server数据库。我应该做REMOTE SQL CONNECTION吗?如果我使用这种方法,其他计算机(未连接到我的LAN)是否能够使用ip,username,数据库名称连接到服务器的sql数据库?



还有一个问题,例如,如果有多台PC连接到服务器,并且正在同时添加数据,那么数据库是否会在PC上刷新/更新自己
?我的意思是用户能够看到实时数据吗?


解决方案

如果数据库在网络上服务器,你应该能够使用服务器的实例名称使用第三个连接字符串
从这里


任何.NET数据提供程序(例如SqlClient数据提供程序)都没有内置任何内容,以允许用户查看实时更改。很多时候人们都会问这个问题并且可能会询问有关使用Timer组件的问题,但是存在无数问题。
唯一真正的方法是使用类SqlDependency。这个类工作得很好但需要大量的配置服务器端。从下一页开始,您还可以了解所有这些限制。有五个主题(页面)可以运行
到。


https://technet.microsoft.com/en-us/library/ms188323(v = sql.105).aspx



i have a small office.I want to develop a database app in vb.net.What i want is i want all my computers be able to connect to the sql server database which will be stored on the server. Should i do the REMOTE SQL CONNECTION thing?and if i use this method, will other computers(not connected to my LAN)be able to connect to the server's sql database using the ip,username,database name?

One more question, for example,if multiple pc's are connected to the server,and are adding data at the same time, so will the database refresh/update itself on ther pc's ? i mean will user's be able to see real time data ?

解决方案

If the database is on a network server you should be able to use the third connection string from here using the instance name of the server.

There is nothing built in to any of the .NET data provider (e.g. SqlClient data provider) to allow users to see real time changes. Many times people ask this question and might ask about using a Timer component yet there are countless issues with this. The only true way is using a class SqlDependency. This class works great yet requires a good deal of configuration server side. There are limitations also which you can learn about all of this starting on the following page. There are five topics (pages) to run through.

https://technet.microsoft.com/en-us/library/ms188323(v=sql.105).aspx


这篇关于如何让我的所有电脑连接到服务器中的SQL数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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