How best to structure .Net Code

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.
 
J

John

Seams ok to me, I think thats what I'd do. But im fairly noobish
myself....there may be a better way...

For mine, the quality of code snippits is of little concern as they can be
fixed easily. What is important is the whole architecture, you get that
wrong and its a nightmare for the next person...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top