Click here to Skip to main content
15,912,897 members
Home / Discussions / C#
   

C#

 
GeneralRe: Problem with SQLDataReader and Insert command Pin
Pete O'Hanlon22-Nov-11 3:03
mvePete O'Hanlon22-Nov-11 3:03 
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 
The purpose of the application is to collect various metrics for individual machines and write those metrics to a SQL table.

In order:-

Service is installed via a msi per individual machine
Service auto-starts and logs the start in the Application & System logs
If this is the first time the code runs, the system queries the 'identity' table for its ID by looking for the id number associated with it name, adds its name to the table if it isn't there already then retrieves the ID number associated with its name and uses that ID 'forever'

* is there a way to set this ID in the code or does it need to get its ID every time?( I would prefer not to use a "cookie" approach nor to write a text file to a file).

on_timed_event_1 fires up
uses the ID allocated above to write the various metrics to the various tables

on_timed_event_2 fires up
uses the ID allocated above to write the various metrics to the various tables

"is the system name just meant to be retrieved once per machine?" - no/yes. The machine uses its system name to identify itself. Once that name is in the table and the system's id has been allocated it uses that id for every transaction afterwards(the id is used as the foreign key in all the other tables)

"Are you attempting to put the service onto individual machines and that's what the above code is to identify" - yes

"has the system previously been registered or not (and register it if it hasn't)?" - exactly

Is this explanation a bit better?
GeneralRe: Problem with SQLDataReader and Insert command Pin
Pete O'Hanlon23-Nov-11 1:22
mvePete O'Hanlon23-Nov-11 1:22 
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 

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.