如何从其他客户端插入新数据时更新wpf gridview [英] How to update wpf gridview when new data is inserted from other client

查看:120
本文介绍了如何从其他客户端插入新数据时更新wpf gridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在为多个用户开发一个新的用于Invertory System的WPF应用程序。

我需要在不同的计算机上安装我的应用程序,一台计算机将设置作为服务器。

例如,

如果PC1正在创建新的销售账单,而PC2正在查看gridview中的今日销售清单。

当PC1完成整个过程并保存账单时,PC2需要在PC1无需用户交互的情况下保存账单的同时自动更新网格视图。









有问候,

Mohammed Rafsanjany

解决方案

< blockquote>基本思路是使用 SQLDependency类 [ ^ ]。

有关详细信息,请参阅ase见:

使用SqlDependency检测更改 [ ^ ]

使用SqlDependency Windows应用程序 [ ^ ]

CP KB:

使用SqlDependency进行数据更改事件 [ ^ ]

使用SqlDependency和SqlCacheDependency查询通知 [ ^ ]



进一步问题的答案:是否可以将它与WPF一起使用?是的,它是。

请参阅:

http://stackoverflow.com/questions/9070255/wpf-application-sql-dependency [ ^ ]

使用SQL数据库通信WPF Windows应用程序 [ ^ ]


Hi,
I'm developing a new WPF application for Invertory System for multiple users.
I need to install my application on different computer and one computer will set to as a server.
For example,
If PC1 is creating a new bill for sales, and PC2 is viewing todays sales list in gridview.
When PC1 complete the process and saves the bill, PC2 need to automatically update the gridview at the same time when PC1 saves the bill without user interaction.




With Regards,
Mohammed Rafsanjany

解决方案

The basic idea is to use SQLDependency class[^].
For further information, please see:
Detecting Changes with SqlDependency[^]
Using SqlDependency in a Windows Application [^]
CP KB:
Using SqlDependency for data change events[^]
Query Notification using SqlDependency and SqlCacheDependency[^]

And the answer for further question: Is it possible to use it with WPF? Yes, it is.
Please, see:
http://stackoverflow.com/questions/9070255/wpf-application-sql-dependency[^]
Communicating your WPF Windows application with SQL Database[^]


这篇关于如何从其他客户端插入新数据时更新wpf gridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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