CMW,
Based on your email, I should offer a word of caution.
Remember with a DataSet, you are going to download the entire table into the
data set.
You can use a for each to check each row, when you update a row it will be
marked internally as such. You can add rows to the other table, they will
also be flagged as such.
At the end of the process you can use a couple DataAdapters to then update
the SQL Server with the modified data.
I would recommend you check out Sceppa's book.
As I really see you have three options here:
1. Create a SQL Stored Procedure with a cursor & do every thing in SQL
Server, you could even schedule this SP to run periodically, or at the end
of the initialize import.
2. Use a DataSet to process the data, which is what I outlined in my
original response.
3. Use only a DataCommand to create a DataReader to read one record at a
time, if any changes are needed use a second DataCommand to update that row.
A third DataCommand could be used to insert records into your second table.
Sceppa's book should help you decide between 2 & 3. From a performance point
of view 3 will probably be faster, however 2 may be more straight forward to
program. The advantage of 2 is you can save the DataSet as an XML file,
which the second VB app would load and make any changes as the second app
made changes it would then update the SQL Server, the first program would
not update the SQL Server in this case... In fact the original input could
simple put the data in a DataSet...
Hope this helps
Jay
"CMW" <co*************@hotmail.com> wrote in message
news:lfDlb.2242$e01.3206@attbi_s02...
In VB.NET I'm retrieving a single table from a SQL Server (tblformdata). I
need to search each record in the dataset to see if any data is missing
from the records (i.e., missing first name, missing last name, missing city,
missing state, missing zip, etc.). If I find that a column data is missing
from a record (i.e., last name), I'd like to update a column/field with a
code indicating data is missing (i.e., ErrorCode = 100). Later, another VB
app will only display records with the ErrorCode column set to 100 to
allow a user to correct the missing data.
Can anyone give me some sample code that shows how I might loop through
each record in the dataset to check for any missing column data?
Thank you.
CMW