Click here to Skip to main content
15,896,606 members
Home / Discussions / C#
   

C#

 
GeneralRe: Problem with SQLDataReader and Insert command Pin
CCodeNewbie22-Nov-11 9:50
CCodeNewbie22-Nov-11 9:50 
GeneralRe: Problem with SQLDataReader and Insert command Pin
Pete O'Hanlon22-Nov-11 10:20
mvePete O'Hanlon22-Nov-11 10:20 
GeneralRe: Problem with SQLDataReader and Insert command Pin
CCodeNewbie22-Nov-11 11:43
CCodeNewbie22-Nov-11 11:43 
GeneralRe: Problem with SQLDataReader and Insert command Pin
Pete O'Hanlon22-Nov-11 22:51
mvePete O'Hanlon22-Nov-11 22:51 
GeneralRe: Problem with SQLDataReader and Insert command Pin
CCodeNewbie22-Nov-11 23:06
CCodeNewbie22-Nov-11 23:06 
GeneralRe: Problem with SQLDataReader and Insert command Pin
Pete O'Hanlon23-Nov-11 0:53
mvePete O'Hanlon23-Nov-11 0:53 
GeneralRe: Problem with SQLDataReader and Insert command Pin
CCodeNewbie23-Nov-11 1:12
CCodeNewbie23-Nov-11 1:12 
GeneralRe: Problem with SQLDataReader and Insert command Pin
Pete O'Hanlon23-Nov-11 1:22
mvePete O'Hanlon23-Nov-11 1:22 
Right - that's fairly straighforward then. OK, how I would structure this (very loosely):

I would have a manager class which was responsible for triggering the different timed events. This class would also be responsible for triggering the insert/lookup into the database of the system identifier (if I was doing this, I would put this in a separate data layer which could easily be mocked for testing purposes, and I would have the data access happen on a background thread in order not to slow down the startup of the service too much).

I would keep the identifier as a property in the manager class. Now, the manager class would be a member of the service class, and I would instaniate it in the OnStartup event (triggering the system identification).

I hope that this gives you some ideas.

Forgive your enemies - it messes with their heads

"Mind bleach! Send me mind bleach!" - Nagy Vilmos


My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility


GeneralRe: Problem with SQLDataReader and Insert command Pin
CCodeNewbie23-Nov-11 10:19
CCodeNewbie23-Nov-11 10:19 
GeneralRe: Problem with SQLDataReader and Insert command Pin
Pete O'Hanlon23-Nov-11 23:44
mvePete O'Hanlon23-Nov-11 23:44 
GeneralRe: Problem with SQLDataReader and Insert command Pin
CCodeNewbie24-Nov-11 9:55
CCodeNewbie24-Nov-11 9:55 
GeneralRe: Problem with SQLDataReader and Insert command Pin
Pete O'Hanlon24-Nov-11 22:30
mvePete O'Hanlon24-Nov-11 22:30 
GeneralRe: Problem with SQLDataReader and Insert command Pin
CCodeNewbie24-Nov-11 22:32
CCodeNewbie24-Nov-11 22:32 
GeneralRe: Problem with SQLDataReader and Insert command Pin
Pete O'Hanlon24-Nov-11 22:48
mvePete O'Hanlon24-Nov-11 22:48 
GeneralRe: Problem with SQLDataReader and Insert command Pin
CCodeNewbie24-Nov-11 22:51
CCodeNewbie24-Nov-11 22:51 
GeneralRe: Problem with SQLDataReader and Insert command Pin
CCodeNewbie25-Nov-11 10:51
CCodeNewbie25-Nov-11 10:51 
GeneralRe: Problem with SQLDataReader and Insert command Pin
Pete O'Hanlon30-Nov-11 5:34
mvePete O'Hanlon30-Nov-11 5:34 
GeneralRe: Problem with SQLDataReader and Insert command Pin
CCodeNewbie30-Nov-11 8:55
CCodeNewbie30-Nov-11 8:55 
GeneralRe: Problem with SQLDataReader and Insert command Pin
Pete O'Hanlon30-Nov-11 11:13
mvePete O'Hanlon30-Nov-11 11:13 
GeneralRe: Problem with SQLDataReader and Insert command Pin
CCodeNewbie30-Nov-11 11:21
CCodeNewbie30-Nov-11 11:21 
GeneralRe: Problem with SQLDataReader and Insert command Pin
Pete O'Hanlon30-Nov-11 11:29
mvePete O'Hanlon30-Nov-11 11:29 
AnswerRe: Problem with SQLDataReader and Insert command Pin
Pete O'Hanlon21-Nov-11 8:48
mvePete O'Hanlon21-Nov-11 8:48 
GeneralRe: Problem with SQLDataReader and Insert command Pin
CCodeNewbie21-Nov-11 21:45
CCodeNewbie21-Nov-11 21:45 
GeneralRe: Problem with SQLDataReader and Insert command Pin
Pete O'Hanlon21-Nov-11 22:01
mvePete O'Hanlon21-Nov-11 22:01 
GeneralRe: Problem with SQLDataReader and Insert command Pin
CCodeNewbie21-Nov-11 22:53
CCodeNewbie21-Nov-11 22:53 

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.