[英]Display latest inserted data in .NET Compact Framework application
I am developing application which should be compatible with Window CE 4.x and above version. 我正在开发应该与Window CE 4.x及以上版本兼容的应用程序。 So, I decided to select .NET compact Framework 2.0 for development option.
所以,我决定选择.NET compact Framework 2.0作为开发选项。
But now I have situation that I am not able to find any proper solution for my below requirement. 但现在我的情况是,我无法找到适合我的下列要求的解决方案。
Requirement; 需求;
My application requirement is to display information of database table in application via Web service. 我的应用需求是通过Web服务在应用程序中显示数据库表的信息。
Problem: 问题:
Here information in table is dynamic and it will be inserted inserted every few seconds/minutes and .NET CF application should be display latest (last 4 or configured N) information. 表中的信息是动态的,它将每隔几秒/分钟插入一次,.NET CF应用程序应显示最新的(最后4个或配置的N)信息。
I am thinking to implement pull technology in application where application will do web service call every 2/5 seconds or few minutes but this approach is not looking good as it will increase the unnecessary service call as it is possible that new information inserted after some minutes. 我正在考虑在应用程序中实现pull技术,其中应用程序将每2/5秒或几分钟进行Web服务调用,但这种方法看起来不太好,因为它会增加不必要的服务调用,因为有可能在几分钟后插入新信息。
So, I am thinking to use push technology in application where server will send notification to .NET compact framework application (client) on new record insert in database table. 所以,我想在应用程序中使用推送技术,服务器将在.NET压缩框架应用程序(客户端)上向数据库表中的新记录插入发送通知。 Notification has message with primary key of record so, .NET compact framework application will call web service method with primary key on push notification from server and display information in application.
因此,通知具有记录主键的消息,.NET紧凑框架应用程序将在服务器的推送通知中使用主键调用Web服务方法并在应用程序中显示信息。
Above push technology approach is looking easy with words but I don't have an idea about it's implementation. 上面的推送技术方法看起来很简单,但我对它的实现并不了解。
I tried to search solution/example for same on internet but could not able find. 我试图在互联网上搜索解决方案/示例,但无法找到。
Can anyone help me on push technology approach ? 任何人都可以帮我推送技术方法吗? How I can implement it in my application?
我如何在我的应用程序中实现它?
To be able to push something the app needs a service that is waiting for a push all the time. 为了能够推送应用程序需要一个等待推送的服务。 That can be a socket connection that is signaled by the service, Or it can be a SMS send to the device and processed by the app.
这可以是由服务发出信号的套接字连接,也可以是发送到设备并由应用程序处理的SMS。
Unfortunately there is no standard PUSH notification support on Windows Mobile as with Android, iOS and Windows Phone. 遗憾的是,Windows Mobile上没有与Android,iOS和Windows Phone一样的标准PUSH通知支持。
在Windows Phone上没有PUSH Notification支持,您可以通过APP可以不断尝试等待PUSH的任何类型的服务来实现这一点......
I implemented below solution to get latest inserted data in .net compact framework application. 我实现了以下解决方案,以获取.net紧凑框架应用程序中的最新插入数据
SqlTableDependency.OnChange
event and new record insert data message will be send to all the connected client (Windows CE Application) to the TCP Server. SqlTableDependency.OnChange
事件中获取通知,并将新记录插入数据消息发送到所有连接的客户端(Windows CE Application)到TCP Server。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.