简体   繁体   English

在.NET Compact Framework应用程序中显示最新插入的数据

[英]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紧凑框架应用程序中的最新插入数据

  • 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. 我创建了托管在Windows服务器上的Windows服务应用程序,并观察SQL服务器数据库表以获取新记录插入的通知。 For this I have used TableDependency Library 为此,我使用了TableDependency Library
  • This window service also start TCP server (IP Address & Port) 此窗口服务还启动TCP服务器(IP地址和端口)
  • 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. 现在一旦在SQL Server表中插入新数据,Window服务应用程序将在SqlTableDependency.OnChange事件中获取通知,并将新记录插入数据消息发送到所有连接的客户端(Windows CE Application)到TCP Server。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 显示最新更新的数据 - Display the latest updated data 没有使用实体框架将数据插入SQL表 - Data is not inserted into SQL table using entity framework vb sql命令已插入,但数据库中未显示数据 - vb sql command inserted but not data display in database 数据不会使用实体框架插入到数据库中 - Data doesn't get inserted into the database using Entity Framework 如何使用实体框架将DbGeography数据保存到SQL Server Compact? - How do I save DbGeography data to SQL Server Compact using Entity Framework? 使用同步框架将数据从多个sql紧凑型数据库合并到中央sql服务器数据库的解决方案 - Solution for merging data from multiple sql compact databases to a central sql server database using sync framework 将数据插入Sql Compact - Insert data into Sql Compact 如何使用System.Data.SqlClient.SqlConnection将.net 2.0框架应用程序连接到SQL Server 2014 - How to connect .net 2.0 framework application to SQL Server 2014 using System.Data.SqlClient.SqlConnection 如何在vb.net中显示消息框以了解数据是否已成功插入? - How to show a messagebox in vb.net to know data are successfully inserted? 无法使用实体框架和 SQL 服务器数据库访问 ASP.NET MVC web 应用程序中的数据 - Unable to access data in an ASP.NET MVC web application using Entity Framework and SQL Server database
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM