Update database every 30 minutes once
I am working on C#.Net Windows application with SQL Server 2005. This project i am using ADO.Net Data-service for database maintenance. I am working on industrial automation domain, here data keep on reading more than 8 hours. After reading data from device based on the trigger i have periodically update data to database. for example
start reading data on 9.00AM, trigger firing on 9.50AM. Once trigger fire, last 30 minutes(9.20 AM to 9.50AM) data store into data base. After trigger firing keep on reading data from device and store into data base.
10.00AM trigger going to off at time storing data to database 开发者_运维知识库has to be stop. Again trigger firing on 11.00AM. Once trigger fire, last 30 minutes(10.30 AM to 11.00AM) data store into data base. After trigger firing keep on reading data from device and store into data base.
After 10.00AM trigger not firing means data keep on store locally.
Here i don't know until trigger fire keep on reading data where & how to maintain temporarily , After trigger firing, last 30 minutes data how to bring and store into database. I don't know how to achieve it. It would be great if anyone could suggest any idea.
Thanks
If your application is running the entire time you can just use a standard Windows.Forms.Timer, set with the appropriate timeout. Every timeout event you can start off the process of updating your database.
I haven't used ADO.NET much, but I believe you can temporarily store data in your DataSet object (or whatever the object that locally stores the database representation). When you are ready you can push that data from the object to the database.
精彩评论