Yes, you can and should use better solution.
#1. Hard to invent anything worse that logging into Notepad. Log to system log using the class
System.EventLog
.
Please see my advanced samples and advices on
EventLog
in the pages on these Questions:
How to create event log under a folder[
^]
MsBuild OutPut to the TextBox on the fly in Windows Application[
^]
#2. Prefer not using timer. Actually, avoid it by all means. It's very hard to avoid several kinds of problems. Use a thread periodically polling your database. Create a separate thread and permanently use it. The period of polling will be defined by
System.Threading.Thread.Sleep
.
I collected essential references to my past Answers on threading and Invocation (needed to use UI) here:
How to get a keydown event to operate on a different thread in vb.net[
^]
If you need some motivation of these approaches, I'll answer separately. I also have a collection of directions and samples on threading and logging from my past Answers, but all in C# (but more in English :-) … Well, to get good help on .NET and code samples you need at least some understanding of C#, anyway.
I added some references to past Answers. You can ignore the fact that applications are very different. Most advices will be quite applicable to yours. Feel free to ask follow-up Questions.
—SA