Click here to Skip to main content
15,892,199 members
Home / Discussions / C#
   

C#

 
QuestionSQL Table Pin
kibromg15-Jul-09 6:12
kibromg15-Jul-09 6:12 
AnswerRe: SQL Table Pin
dan!sh 15-Jul-09 6:19
professional dan!sh 15-Jul-09 6:19 
GeneralRe: SQL Table Pin
kibromg15-Jul-09 6:53
kibromg15-Jul-09 6:53 
GeneralRe: SQL Table Pin
kibromg15-Jul-09 7:01
kibromg15-Jul-09 7:01 
GeneralRe: SQL Table Pin
dan!sh 15-Jul-09 7:03
professional dan!sh 15-Jul-09 7:03 
GeneralRe: SQL Table Pin
kibromg15-Jul-09 7:15
kibromg15-Jul-09 7:15 
GeneralRe: SQL Table [modified] Pin
musefan15-Jul-09 8:08
musefan15-Jul-09 8:08 
AnswerRe: SQL Table Pin
Luc Pattyn15-Jul-09 8:24
sitebuilderLuc Pattyn15-Jul-09 8:24 
GeneralRe: SQL Table Pin
musefan15-Jul-09 21:53
musefan15-Jul-09 21:53 
AnswerRe: SQL Table Pin
Pete O'Hanlon15-Jul-09 10:02
mvePete O'Hanlon15-Jul-09 10:02 
GeneralRe: SQL Table Pin
Not Active15-Jul-09 10:10
mentorNot Active15-Jul-09 10:10 
QuestionHow to implement a timer in Windows Service correctly? Pin
astv15-Jul-09 5:16
astv15-Jul-09 5:16 
AnswerRe: How to implement a timer in Windows Service correctly? Pin
DoctorMick15-Jul-09 6:04
DoctorMick15-Jul-09 6:04 
GeneralRe: How to implement a timer in Windows Service correctly? Pin
astv15-Jul-09 6:13
astv15-Jul-09 6:13 
GeneralRe: How to implement a timer in Windows Service correctly? Pin
DoctorMick15-Jul-09 6:26
DoctorMick15-Jul-09 6:26 
GeneralRe: How to implement a timer in Windows Service correctly? Pin
astv15-Jul-09 10:41
astv15-Jul-09 10:41 
GeneralRe: How to implement a timer in Windows Service correctly? Pin
Luc Pattyn15-Jul-09 6:26
sitebuilderLuc Pattyn15-Jul-09 6:26 
GeneralRe: How to implement a timer in Windows Service correctly? Pin
astv15-Jul-09 10:43
astv15-Jul-09 10:43 
GeneralRe: How to implement a timer in Windows Service correctly? Pin
Paladin200015-Jul-09 6:27
Paladin200015-Jul-09 6:27 
GeneralRe: How to implement a timer in Windows Service correctly? Pin
astv15-Jul-09 10:45
astv15-Jul-09 10:45 
AnswerRe: How to implement a timer in Windows Service correctly? Pin
dan!sh 15-Jul-09 6:28
professional dan!sh 15-Jul-09 6:28 
QuestionOutlook newitem event issue [modified] Pin
ghoster00715-Jul-09 5:06
ghoster00715-Jul-09 5:06 
AnswerRe: Outlook newitem event issue Pin
Luc Pattyn15-Jul-09 6:19
sitebuilderLuc Pattyn15-Jul-09 6:19 
GeneralRe: Outlook newitem event issue Pin
ghoster00715-Jul-09 7:00
ghoster00715-Jul-09 7:00 
GeneralRe: Outlook newitem event issue Pin
Luc Pattyn15-Jul-09 7:08
sitebuilderLuc Pattyn15-Jul-09 7:08 
OK, my advice is:

1.
to have one big try-catch on every thread, so basically the first thing a thread does is enter its try block. For the main thread that would be the static Main() method, for any other thread/ThreadPoolWorkItem/BackgroundWorker that would be the method you pass them; for asynchronous callbacks (Timers/SerialPorts/other input-output) that would be the handlers you provide.

All the above are safety nets, they don't solve any problem your app may encounter, but at least they would inform you, the developer.

2.
add lots of logging, either to a file or to a Console (not to EventViewer, not to the GUI); have each line include current time (up to the millisecond if relevant) the ManagedThreadId, one text message, and some relevant data (such as mail count).
If logging to file, I tend to use File.AppendText, so basically the file is closed all the time, and a crash does not keep me from reading the most recent messages.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.