I am trying to achieve the following: I am using MySQL and ASP.NET. I am creating a counter in a table. I want that counter columns to be reset to zero every day. Is there any option to achieve this and how.
I don't want to use admin tasks in Windows, and not to create .exe file. I prefer be able to do that in C#, in code.
The way I thought in solving this is to create an Application variable that will be set to false. In the application page, I will query the DateTime.Now and get the current hour. If the hour is 12:00 and the Application variable is false, run a function, else, do nothing. If the time is 13:00 and Application variable equals to false, set it to true.
I do that in an hour difference just to make sure that it runs. Every user that visited my page will trigger that if statements. However, the function will run only once a day.
Is it a good solution?