473,386 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Windows Service for Reminder/Alarm

Hi all,

I would like to create a very simple 'lite' version of Outlook Calendar's
reminder function. I will use a windows service that will read timedate
stamps from a db and compare them to Now. This seems that it will create a
lot of processor overhead in terms of 'how often shall I check the db?'. I
wonder if I check it hourly and save additional info. as a timespan...I just
don't know......has anyone got any ideas of best practice for this sort of
thing?

Thanks in advance.

Phil
Dec 12 '05 #1
9 2780
How often do new things get added to the DB?

I would suggest that you only read from the DB when you know there are new
things to read in, then once the things are read in keep the list in memory
and simply track times.

"Phil G." <Ph**@nospam.com> wrote in message
news:dn**********@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
Hi all,

I would like to create a very simple 'lite' version of Outlook Calendar's
reminder function. I will use a windows service that will read timedate
stamps from a db and compare them to Now. This seems that it will create a
lot of processor overhead in terms of 'how often shall I check the db?'. I
wonder if I check it hourly and save additional info. as a timespan...I
just don't know......has anyone got any ideas of best practice for this
sort of thing?

Thanks in advance.

Phil

Dec 12 '05 #2
Hi Ray,

The 'notes' will be added manually by the user and it will be as-and-when.
The db will be held on the local machine and it will probably be switched
on/off daily. So, are you perhaps suggesting a check of the db on startup,
any reminders for that day would then be held in memory under a timespan? I
haven't done much in this area! Would I need to use callback methods? Would
this involve multiple threads if there is more than one reminder for that
day? You state to 'keep the list in memory'...how?

Thanks for your help/input.

Cheers, Phil

"Ray Cassick (Home)" <rc************@enterprocity.com> wrote in message
news:eJ**************@TK2MSFTNGP11.phx.gbl...
How often do new things get added to the DB?

I would suggest that you only read from the DB when you know there are new
things to read in, then once the things are read in keep the list in
memory and simply track times.

"Phil G." <Ph**@nospam.com> wrote in message
news:dn**********@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
Hi all,

I would like to create a very simple 'lite' version of Outlook Calendar's
reminder function. I will use a windows service that will read timedate
stamps from a db and compare them to Now. This seems that it will create
a lot of processor overhead in terms of 'how often shall I check the
db?'. I wonder if I check it hourly and save additional info. as a
timespan...I just don't know......has anyone got any ideas of best
practice for this sort of thing?

Thanks in advance.

Phil


Dec 12 '05 #3
My suggestion would be to have a FileSystemWatcher in your service. Have it
watch for LastWriteTime, and trigger your routines on that.

Keep the list in memory by keeping it in a DataTable or maybe an ArrayList.

"Phil G." <Ph**@nospam.com> wrote in message
news:dn**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com...
Hi Ray,

The 'notes' will be added manually by the user and it will be as-and-when.
The db will be held on the local machine and it will probably be switched
on/off daily. So, are you perhaps suggesting a check of the db on startup,
any reminders for that day would then be held in memory under a timespan?
I haven't done much in this area! Would I need to use callback methods?
Would this involve multiple threads if there is more than one reminder for
that day? You state to 'keep the list in memory'...how?

Thanks for your help/input.

Cheers, Phil

"Ray Cassick (Home)" <rc************@enterprocity.com> wrote in message
news:eJ**************@TK2MSFTNGP11.phx.gbl...
How often do new things get added to the DB?

I would suggest that you only read from the DB when you know there are
new things to read in, then once the things are read in keep the list in
memory and simply track times.

"Phil G." <Ph**@nospam.com> wrote in message
news:dn**********@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
Hi all,

I would like to create a very simple 'lite' version of Outlook
Calendar's reminder function. I will use a windows service that will
read timedate stamps from a db and compare them to Now. This seems that
it will create a lot of processor overhead in terms of 'how often shall
I check the db?'. I wonder if I check it hourly and save additional
info. as a timespan...I just don't know......has anyone got any ideas of
best practice for this sort of thing?

Thanks in advance.

Phil



Dec 12 '05 #4
Hi Terry,

Do you ever get the feeling that everyone else is on the same page and
you're someone in the foreword! :-)

I am starting to feel lost! So, I have this datatable or arraylist. Such an
object holds the data, in this case a time and date. I must still be
'tracking' the next or 1st time/date from the current time. What is the
correct method of doing this tracking and how will I fire an event when
current time = time in one of my datatable records?

Sorry if I am now sounding dumb!!!

"Terry Olsen" <to******@hotmail.com> wrote in message
news:uh**************@TK2MSFTNGP11.phx.gbl...
My suggestion would be to have a FileSystemWatcher in your service. Have
it watch for LastWriteTime, and trigger your routines on that.

Keep the list in memory by keeping it in a DataTable or maybe an
ArrayList.

"Phil G." <Ph**@nospam.com> wrote in message
news:dn**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com...
Hi Ray,

The 'notes' will be added manually by the user and it will be
as-and-when. The db will be held on the local machine and it will
probably be switched on/off daily. So, are you perhaps suggesting a check
of the db on startup, any reminders for that day would then be held in
memory under a timespan? I haven't done much in this area! Would I need
to use callback methods? Would this involve multiple threads if there is
more than one reminder for that day? You state to 'keep the list in
memory'...how?

Thanks for your help/input.

Cheers, Phil

"Ray Cassick (Home)" <rc************@enterprocity.com> wrote in message
news:eJ**************@TK2MSFTNGP11.phx.gbl...
How often do new things get added to the DB?

I would suggest that you only read from the DB when you know there are
new things to read in, then once the things are read in keep the list in
memory and simply track times.

"Phil G." <Ph**@nospam.com> wrote in message
news:dn**********@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
Hi all,

I would like to create a very simple 'lite' version of Outlook
Calendar's reminder function. I will use a windows service that will
read timedate stamps from a db and compare them to Now. This seems that
it will create a lot of processor overhead in terms of 'how often shall
I check the db?'. I wonder if I check it hourly and save additional
info. as a timespan...I just don't know......has anyone got any ideas
of best practice for this sort of thing?

Thanks in advance.

Phil



Dec 12 '05 #5
Phil,
In addition to the other comments.

Have you considered using SQL Notification Services to have your app
notified when changes are made to the database?

http://www.microsoft.com/sql/technol...n/default.mspx
When you app starts it could determine when the next event occurs & wait for
the event. If a table change occurs before the event, the service could wake
up (due to the notification services) and recalculate when the next event
occurs.

I know .NET 2.0 has some support for SQL Notification Services, however I'm
not sure how much is exposed for your Windows Service to leverage them...
--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Phil G." <Ph**@nospam.com> wrote in message
news:dn**********@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
| Hi all,
|
| I would like to create a very simple 'lite' version of Outlook Calendar's
| reminder function. I will use a windows service that will read timedate
| stamps from a db and compare them to Now. This seems that it will create a
| lot of processor overhead in terms of 'how often shall I check the db?'. I
| wonder if I check it hourly and save additional info. as a timespan...I
just
| don't know......has anyone got any ideas of best practice for this sort of
| thing?
|
| Thanks in advance.
|
| Phil
|
|
Dec 12 '05 #6
Maybe something like this.

Create a Item class that contains all the details you need about your
'thing' in the database. This would probably have something like date and
time of the note, reminder time(in case you want to remind in advance like
Outlook does), and item description and a index to the DB so you can do a
look up. Each Item class will raise an event with it's time is up.

Create a controller class that reads the DB, grabs each note and builds a
separate instance of the Item class then creates a thread for each item that
will track the time tracking. The controller would get the events form each
Item instance and then use them to populate a dialog box (not sure if you
plan to do a GUI or not) like Outlook does to show the reminder. If no GUI
(take care if you want to show a GUI from a service here - you should do the
GUI as a separate app) you can just use this to trigger another
thread/process to act on what you want done at that time.

It's not difficult, just a bit time consuming and really not a beginner
task. There was actually a good article in last months Visual Studio
Magazine that would help you out here.

http://www.ftponline.com/vsm/2005_10...ktopdeveloper/

"Phil G." <Ph**@nospam.com> wrote in message
news:dn**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com...
Hi Ray,

The 'notes' will be added manually by the user and it will be as-and-when.
The db will be held on the local machine and it will probably be switched
on/off daily. So, are you perhaps suggesting a check of the db on startup,
any reminders for that day would then be held in memory under a timespan?
I haven't done much in this area! Would I need to use callback methods?
Would this involve multiple threads if there is more than one reminder for
that day? You state to 'keep the list in memory'...how?

Thanks for your help/input.

Cheers, Phil

"Ray Cassick (Home)" <rc************@enterprocity.com> wrote in message
news:eJ**************@TK2MSFTNGP11.phx.gbl...
How often do new things get added to the DB?

I would suggest that you only read from the DB when you know there are
new things to read in, then once the things are read in keep the list in
memory and simply track times.

"Phil G." <Ph**@nospam.com> wrote in message
news:dn**********@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
Hi all,

I would like to create a very simple 'lite' version of Outlook
Calendar's reminder function. I will use a windows service that will
read timedate stamps from a db and compare them to Now. This seems that
it will create a lot of processor overhead in terms of 'how often shall
I check the db?'. I wonder if I check it hourly and save additional
info. as a timespan...I just don't know......has anyone got any ideas of
best practice for this sort of thing?

Thanks in advance.

Phil



Dec 13 '05 #7
Thanks Ray, seems like I can work through (.............I think :-) your
suggestion. At least I get the general gist. I have also just registered on
ftponline and will read the rest of the article that you provided a link to.
Thanks for that.

Best regards.

Phil
"Ray Cassick (Home)" <rc************@enterprocity.com> wrote in message
news:O2**************@TK2MSFTNGP11.phx.gbl...
Maybe something like this.

Create a Item class that contains all the details you need about your
'thing' in the database. This would probably have something like date and
time of the note, reminder time(in case you want to remind in advance like
Outlook does), and item description and a index to the DB so you can do a
look up. Each Item class will raise an event with it's time is up.

Create a controller class that reads the DB, grabs each note and builds a
separate instance of the Item class then creates a thread for each item
that will track the time tracking. The controller would get the events
form each Item instance and then use them to populate a dialog box (not
sure if you plan to do a GUI or not) like Outlook does to show the
reminder. If no GUI (take care if you want to show a GUI from a service
here - you should do the GUI as a separate app) you can just use this to
trigger another thread/process to act on what you want done at that time.

It's not difficult, just a bit time consuming and really not a beginner
task. There was actually a good article in last months Visual Studio
Magazine that would help you out here.

http://www.ftponline.com/vsm/2005_10...ktopdeveloper/

"Phil G." <Ph**@nospam.com> wrote in message
news:dn**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com...
Hi Ray,

The 'notes' will be added manually by the user and it will be
as-and-when. The db will be held on the local machine and it will
probably be switched on/off daily. So, are you perhaps suggesting a check
of the db on startup, any reminders for that day would then be held in
memory under a timespan? I haven't done much in this area! Would I need
to use callback methods? Would this involve multiple threads if there is
more than one reminder for that day? You state to 'keep the list in
memory'...how?

Thanks for your help/input.

Cheers, Phil

"Ray Cassick (Home)" <rc************@enterprocity.com> wrote in message
news:eJ**************@TK2MSFTNGP11.phx.gbl...
How often do new things get added to the DB?

I would suggest that you only read from the DB when you know there are
new things to read in, then once the things are read in keep the list in
memory and simply track times.

"Phil G." <Ph**@nospam.com> wrote in message
news:dn**********@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
Hi all,

I would like to create a very simple 'lite' version of Outlook
Calendar's reminder function. I will use a windows service that will
read timedate stamps from a db and compare them to Now. This seems that
it will create a lot of processor overhead in terms of 'how often shall
I check the db?'. I wonder if I check it hourly and save additional
info. as a timespan...I just don't know......has anyone got any ideas
of best practice for this sort of thing?

Thanks in advance.

Phil



Dec 13 '05 #8
Hi Jay,

.....NO! :-)...

Actually, I have limited experience with SQL in as much as I can create SQL
db's, write/read etc however I am but a poor vb.net hobbyist :-) I don't
have 2005 and only use 2003 with the 1.1 Framework.....perhaps a little over
my head at this point!

Thanks for your comments.

Regards, Phil

"Jay B. Harlow [MVP - Outlook]" <Ja************@tsbradley.net> wrote in
message news:e0**************@TK2MSFTNGP09.phx.gbl...
Phil,
In addition to the other comments.

Have you considered using SQL Notification Services to have your app
notified when changes are made to the database?

http://www.microsoft.com/sql/technol...n/default.mspx
When you app starts it could determine when the next event occurs & wait
for
the event. If a table change occurs before the event, the service could
wake
up (due to the notification services) and recalculate when the next event
occurs.

I know .NET 2.0 has some support for SQL Notification Services, however
I'm
not sure how much is exposed for your Windows Service to leverage them...
--
Hope this helps
Jay [MVP - Outlook]
.NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Phil G." <Ph**@nospam.com> wrote in message
news:dn**********@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
| Hi all,
|
| I would like to create a very simple 'lite' version of Outlook
Calendar's
| reminder function. I will use a windows service that will read timedate
| stamps from a db and compare them to Now. This seems that it will create
a
| lot of processor overhead in terms of 'how often shall I check the db?'.
I
| wonder if I check it hourly and save additional info. as a timespan...I
just
| don't know......has anyone got any ideas of best practice for this sort
of
| thing?
|
| Thanks in advance.
|
| Phil
|
|

Dec 13 '05 #9
Phil,
VS 2003, .NET 1.1, and SQL Server 200, and I believe SQL Server 7.0 also
have access to SQL Notification Services ;-)

SQL Server 2005 just adds some new & expanded features to the mix!

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"Phil G." <Ph**@nospam.com> wrote in message
news:dn**********@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com...
| Hi Jay,
|
| ....NO! :-)...
|
| Actually, I have limited experience with SQL in as much as I can create
SQL
| db's, write/read etc however I am but a poor vb.net hobbyist :-) I don't
| have 2005 and only use 2003 with the 1.1 Framework.....perhaps a little
over
| my head at this point!
|
| Thanks for your comments.
|
| Regards, Phil
|
| "Jay B. Harlow [MVP - Outlook]" <Ja************@tsbradley.net> wrote in
| message news:e0**************@TK2MSFTNGP09.phx.gbl...
| > Phil,
| > In addition to the other comments.
| >
| > Have you considered using SQL Notification Services to have your app
| > notified when changes are made to the database?
| >
| > http://www.microsoft.com/sql/technol...n/default.mspx
| >
| >
| > When you app starts it could determine when the next event occurs & wait
| > for
| > the event. If a table change occurs before the event, the service could
| > wake
| > up (due to the notification services) and recalculate when the next
event
| > occurs.
| >
| > I know .NET 2.0 has some support for SQL Notification Services, however
| > I'm
| > not sure how much is exposed for your Windows Service to leverage
them...
| > --
| > Hope this helps
| > Jay [MVP - Outlook]
| > .NET Application Architect, Enthusiast, & Evangelist
| > T.S. Bradley - http://www.tsbradley.net
| >
| >
| > "Phil G." <Ph**@nospam.com> wrote in message
| > news:dn**********@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com...
| > | Hi all,
| > |
| > | I would like to create a very simple 'lite' version of Outlook
| > Calendar's
| > | reminder function. I will use a windows service that will read
timedate
| > | stamps from a db and compare them to Now. This seems that it will
create
| > a
| > | lot of processor overhead in terms of 'how often shall I check the
db?'.
| > I
| > | wonder if I check it hourly and save additional info. as a
timespan...I
| > just
| > | don't know......has anyone got any ideas of best practice for this
sort
| > of
| > | thing?
| > |
| > | Thanks in advance.
| > |
| > | Phil
| > |
| > |
| >
| >
|
|
Dec 13 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Charles Brown | last post by:
I have a windows service that performs various functions that has recently started to fail on startup. If I remove all event logging from code, it runs fine. If I run the service on a development...
7
by: Doug Stiers | last post by:
I have a VB app that I'm installing as a Windows Service. I want a subroutine in the app to run every 30 minutes during business hours. How do I do this in VB? I set the startup type as automatic...
10
by: John | last post by:
I currently have a Windows Service that runs Transactions that are very Processor/Memory Intensive. I have a requirement to deploy multiple instances of the Web service on the Same server. Each...
4
by: =?Utf-8?B?SmF5RFA=?= | last post by:
HELP! I have a small home network setup. One Desktop for me, one dektop for my two girls, a laptop for work, my wife's laptop, and my son's laptop for college work. All in "WORKGROUP" ...
1
by: =?Utf-8?B?U2FtIE1jSW50eXJl?= | last post by:
I have a big problem - can anyone help a distressed woman here? I installed Zone Alarm Security Suite and then after a while I didn't like the software so I removed it properly, but then...
2
lee123
by: lee123 | last post by:
how do you code a date you want to remind you of something example: lets say you have an appointment and you wanted to be reminded of it on a later date with a msgbox ("Just a Reminder You Have An...
8
by: hambones | last post by:
Heya, I can't seem to find any references to a way that I can set the system alarm clock. I am using a Motorola Q which is running Windows Mobile 5.0 Smartphone. I am not sure if the best...
1
by: =?Utf-8?B?S2F1c2hhbCBNZWh0YQ==?= | last post by:
Hi, Can we have implementation similar to this one ? 1. I have one service host giving me calculator service (on server). 2. I have other service host giving me alarm service (on different...
5
by: mrk98 | last post by:
Hi, I am getting the following error when I try to start the windows service I have written: ReadOutlookService on local computer started and then stopped.Some services stop automatically if...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.