在C#中更新数据库时,更新一台pc的datagridview的数据. [英] update data of datagridview of one pc when database gets updated in C#.

查看:96
本文介绍了在C#中更新数据库时,更新一台pc的datagridview的数据.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.
我有一个问题.有两台计算机在lan中工作.在一台计算机中,我的C#应用​​程序接收数据.而在其他系统上,数据应自动显示为&当数据库由1st pc更新时.

示例:
当您在披萨店订购披萨时,销售人员会在系统中输入该订单,它会自动转到厨房部门煮比萨.因此在厨房中,订单列表应自动更新为&当销售人员接受新订单时.
订单列表应显示在c#的datagridview中.


谢谢.

Hi Guys.
i have a question.there are two pcs working in lan.in one pc my c# application recieves data.while on other system that data should automatically display as & when the database gets updated by 1st pc.

Example:
when u order pizza at pizza store .sales guy feeds that order in the system & it automatically goes to the kitchen department to cook that pizza.so in kitchen the order list should get automatically update as & when sales guy takes new order.
the order list should display in datagridview in c#.


Thanks.

推荐答案



a)第一个选择是计时器.

b)如果您使用一个集中式数据,则可以使用sqlcache依赖项.

c)如果数据库不同,则可以使用数据库镜像.
Hi,

a) First option is Timer.

b) If you are using one centralized data then you can use sqlcache dependency.

c) if different databases then you can use database mirroring.


侦听应用程序应具有专用于按时间间隔检查数据库的线程.
该线程用于在侦听器执行其操作时可以更新UI.
如解决方案1所述,使用计时器作为执行定期检查的方法.
The listening application should have a thread dedicated to checking the database on an interval.
The thread is used to that the UI can be updated while the listener is doing its thing.
As Solution 1 says, use a Timer as a way to perform the periodic checks.


这篇关于在C#中更新数据库时,更新一台pc的datagridview的数据.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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