A
Andy Baker
Hello,
I have a VB.NET 2003 compact framework application. The application will be
running all the time on a mobile device, and part of the requirements is for
the device to access the main SQL Server 2000 database during the night to
upload updated data. The device may possibly be in standby mode at this
point, so if it is, I need to wake it up. I have found some C# code that
uses the OpenNETCF RunAppAtTime method to run an application at a specified
time, that I have incorporated into my app, and it does wake up the device
at the time that I want it to. However, there are a few potential problems
that I can see with this approach.
1) I don't want to run an application, my application will be always
running, so all I need to do is wake up the device. (This doesn't seem to
matter).
2) I can only set the wake up time to a specific date and time. I want
it to be every night (or every working night) at the same time. This means
that I need to set the date and time for the next working day after
uploading, or on start of the application if it is being run for the first
time.
Would setting the same reminder more than once cause any problems?
3) I do not know how to cancel a reminder once set. Is there a way to
see what reminders have been set - at the moment I am keeping a registry
entry with the date of the last reminder, and if it has already been set,
don't do it again.
3) It seems like a very complicated method, with a great potential for
mistakes. Is there a better way?
Unfortunately my C# skills are fairly limited, so although I have got
the code to work, I am not sure exactly what it is doing. I am concerned
that it may be causing me problems - I can see the device grinding to a halt
because I have so many threads running setting reminders all over the place.
Any advice would be appreciated.
Andy Baker
I have a VB.NET 2003 compact framework application. The application will be
running all the time on a mobile device, and part of the requirements is for
the device to access the main SQL Server 2000 database during the night to
upload updated data. The device may possibly be in standby mode at this
point, so if it is, I need to wake it up. I have found some C# code that
uses the OpenNETCF RunAppAtTime method to run an application at a specified
time, that I have incorporated into my app, and it does wake up the device
at the time that I want it to. However, there are a few potential problems
that I can see with this approach.
1) I don't want to run an application, my application will be always
running, so all I need to do is wake up the device. (This doesn't seem to
matter).
2) I can only set the wake up time to a specific date and time. I want
it to be every night (or every working night) at the same time. This means
that I need to set the date and time for the next working day after
uploading, or on start of the application if it is being run for the first
time.
Would setting the same reminder more than once cause any problems?
3) I do not know how to cancel a reminder once set. Is there a way to
see what reminders have been set - at the moment I am keeping a registry
entry with the date of the last reminder, and if it has already been set,
don't do it again.
3) It seems like a very complicated method, with a great potential for
mistakes. Is there a better way?
Unfortunately my C# skills are fairly limited, so although I have got
the code to work, I am not sure exactly what it is doing. I am concerned
that it may be causing me problems - I can see the device grinding to a halt
because I have so many threads running setting reminders all over the place.
Any advice would be appreciated.
Andy Baker