简体   繁体   English

如何从任何已连接的计算机跨LAN更新Visual Studio App数据库

[英]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.

相关问题 Visual Studio - Xamarin,创建连接到数据库的应用程序 - Visual Studio - Xamarin, Creating an App connected to a Database LAN中的Visual Studio 2010数据库 - visual studio 2010 database in LAN 如何从Model,Visual Studio 2012和EF5更新数据库 - How to update database from model, visual studio 2012 and EF5 如何从Visual Studio将图像插入数据库 - How to insert image into database from Visual Studio 如何从局域网运行.mdf数据库? - How to run .mdf database from LAN? 将连接添加到已在另一台计算机上创建的Visual Studio中的数据库 - Add connection to a database in visual studio that is already created on another computer 如何在Visual Studio 2015中为通用应用程序创建本地数据库? - How to create local database for universal app in Visual Studio 2015? 如何在ubuntu中使用相同的局域网将mysql数据库的访问权限授予另一台计算机? - How to give acces to mysql database to another computer using same lan in ubuntu? 如何从 App 中的 Assets 文件夹更新数据库 - How to Update Database from Assets Folder in App 如何从Visual Studio(c ++)中的MySql数据库读取数据? - how to read data from a MySql database in Visual Studio (c++)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM