473,383 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

How best to structure .Net Code

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.

--
Kind Regards
Amelia
Jan 6 '08 #1
1 1187
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...
"Amelia" <Am****@discussions.microsoft.comwrote in message
news:10**********************************@microsof t.com...
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.

--
Kind Regards
Amelia

Jan 6 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Vagif Abilov | last post by:
We decided to adopt .NET coding guidelines posted by Brad Abrams from Microsoft: http://blogs.msdn.com/brada/archive/2005/01/26/361369.aspx Here is what Brad (and AFAIK Microsoft) suggests...
7
by: tgh003 | last post by:
I would be interested to hear how others are managing their javascript (.js) files from the original code vs the obfuscated version they publish to their site/webapp. I currently manage 2 files,...
1
by: Vincent V | last post by:
Hey i am just starting a new project and from the start i want to make sure my app is as Object Orientated as possible I have a couple of questions in relation to this Question 1: Should i...
5
by: Trapulo | last post by:
Hello, I need to send to a webservice a parameter that is a string containing an XML doc. In this xml, a node value came from a byte array (it's an RSA signature). What is the best way to convert...
1
by: Ronald S. Cook | last post by:
We are about to undertake a an app dev project at our company. The overall project has a name (let's say "DBD - Digital Business Design"). Within the scope of the project will be several...
13
by: G | last post by:
Hello, Looking for opinions on a fairly simple task, new to ASP.net (C#) and want to make sure I do this as efficiently as possible. I have a web based form, and I need to run some SQL before...
2
by: David T. Ashley | last post by:
Hi, In my PHP code, I typically break my functions into groups (usually based on the data type they operate on), and then include the files, i.e.: require_once("string_functions.inc");...
3
by: jlamb77 | last post by:
Hi, I am in the process of creating a schema definition to validate some XML data that will look like the following: ProductA SubProductA SubProductB SubProductC
6
by: mirandacascade | last post by:
Assume the following: 1) multi-user environment 2) when user opens app, want to run some code that retrieves some information specific to the user...retrieving this information is somewhat i/o...
1
by: CProgrammer80 | last post by:
I am compiling 4 different programs, each using a lot of the same core functions and files. One of the programs requires access to a large third party library, the others do not. I have created...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.