A
Amelia
Hello,
Apologies for the easy coding questions but I have something I need to code
in .Net and am fairly new to coding and don't want to produce bad code so
after some advice from the experienced please:-
Problem to code:
--------------------
Pick up new records from SQL Server DB table.
Flag records as "being processed" with a status (this flagging as new ones
coming in all the time)
Loop through records - get more detail items (stored proc) and process
Update Status
My Idea how to Code:
--------------------------
In a transaction
Pick up records to process and put into a dataset.
Update the status of these records in DB table
Loop through records in Dataset. Use stored proc to retrieve all other
detail information required at once.
Update status
As I have to update the status of the records I am about to process, I can't
see a better way to process than to put records into a dataset first unless I
lock those records but this APP will be polling so less practical. For
everything else, I was just going to use the System.Data.SqlClient class and
SQL statement calls to get the records, and a Reader to loop through all my
detail data returned via a stored Proc.
Does this sound reasonable. Are there any better ways and should I be usinhg
Enterprise Library ? Thanks very much for the efforts and advice of any
replies! Most appreciated.
Apologies for the easy coding questions but I have something I need to code
in .Net and am fairly new to coding and don't want to produce bad code so
after some advice from the experienced please:-
Problem to code:
--------------------
Pick up new records from SQL Server DB table.
Flag records as "being processed" with a status (this flagging as new ones
coming in all the time)
Loop through records - get more detail items (stored proc) and process
Update Status
My Idea how to Code:
--------------------------
In a transaction
Pick up records to process and put into a dataset.
Update the status of these records in DB table
Loop through records in Dataset. Use stored proc to retrieve all other
detail information required at once.
Update status
As I have to update the status of the records I am about to process, I can't
see a better way to process than to put records into a dataset first unless I
lock those records but this APP will be polling so less practical. For
everything else, I was just going to use the System.Data.SqlClient class and
SQL statement calls to get the records, and a Reader to loop through all my
detail data returned via a stored Proc.
Does this sound reasonable. Are there any better ways and should I be usinhg
Enterprise Library ? Thanks very much for the efforts and advice of any
replies! Most appreciated.