简体   繁体   中英

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. So, I decided to select .NET compact Framework 2.0 for development option.

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.

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.

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.

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. 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.

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.

Unfortunately there is no standard PUSH notification support on Windows Mobile as with Android, iOS and Windows Phone.

在Windows Phone上没有PUSH Notification支持,您可以通过APP可以不断尝试等待PUSH的任何类型的服务来实现这一点......

I implemented below solution to get latest inserted data in .net compact framework application.

  • I created windows service application which hosted on windows server and watch the SQL server database table to get the notification on new record insert. For this I have used TableDependency Library
  • This window service also start TCP server (IP Address & Port)
  • Now once new data inserted in SQL server table, Window service application will get the notification in SqlTableDependency.OnChange event and new record insert data message will be send to all the connected client (Windows CE Application) to the TCP Server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM