[英]How to Update Visual Studio App database across LAN from any connected computer
I have created an application which utilises a database to store information , how do I now allow that information to be updated from any computer connected along the same LAN. 我创建了一个利用数据库存储信息的应用程序,现在如何允许从同一LAN连接的任何计算机更新该信息。 so once someone entered and saves new information them all other databases in the same app will update .
因此,一旦有人输入并保存新信息,他们在同一应用程序中的所有其他数据库将更新。
Private Sub MLGMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Timer1.Start()
'how do i get MLGDatabaseDataSet to be a file path here'
Me.LocationRecordTableAdapter.Fill(Me.MLGDatabaseDataSet.LocationRecord)
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
UPDATETIME = UPDATETIME + 1
Label1.Text = UPDATETIME
If UPDATETIME > 700 Then
'---------------------------------------UPDATE DATABASE-----------------------------------------'
LocationRecordDataGridView.Refresh()
LocationRecordDataGridView.DataSource = Nothing
LocationRecordDataGridView.DataSource = ("C:\Users\User\Documents\folder\MLGDatabase.sdf")
Me.LocationRecordDataGridView.DataSource = LocationRecordBindingSource
LocationRecordBindingSource.RemoveFilter()
LocationRecordDataGridView.Refresh()
LocationRecordDataGridView.Refresh()
UPDATETIME = 0
End If
End Sub
I don't have enough rep yet to just post a comment, but my first question is, if this is a LAN-based application, isn't everyone pulling from the same database? 我还没有足够的代表发表评论,但是我的第一个问题是,如果这是基于LAN的应用程序,不是每个人都从同一个数据库中提取信息吗? Once you update the database from one user, the database should be updated for everyone.
从一位用户更新数据库后,应该为每个人更新数据库。 Of course, if you've got a record source displayed, such as in a DataGridView, you may need to implement a timer to refresh your data source periodically.
当然,如果您显示了记录源(例如在DataGridView中),则可能需要实现一个计时器以定期刷新数据源。 If you're using an RDBMS (SQL Server, PostgreSQL, MySQL, etc.), this should be pretty simple.
如果您使用的是RDBMS(SQL Server,PostgreSQL,MySQL等),这应该非常简单。
I guess a big part of the equation is going to depend on the type of database you're using, and where that database is actually located. 我想方程式的很大一部分将取决于您使用的数据库的类型以及该数据库的实际位置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.