Efficient Iteration of a Dataset

Enigma151

Member
Joined
Jul 9, 2003
Messages
12
I am populating a Dataset by means of SQL. After this, I parse the dataset to make the fields more ledgible (like change unix times (GMT) to EST).

Is it more efficient to iterate column by column or row by row for means to of parsing the items (fields). Right now I am parsing column by column.

Any ideas? I am not real familiar with how efficient this build-in function is.

Ex:
Dim DR As DataRow

For Each DR In DS_Study.Tables(0).Rows()

DR.Item(ColumnNumber) = ....Parsed Data....

Next
 
It makes more sense, programmatically, to loop through each row
and then update the value of each column before continuing to
the next row. That way you could skip specific columns or delete
them if needed. Plus, it would only require one loop.

Since youre doing the same changes, just in a different order,
there should not be a noticeable difference in speed.
 
the other way you could do it is retrieve the xml of the DataSet, then perform a transform of the data, using a XSLT transform, then pass the updated Xml back to the DataSet.
 
Hi dsgreen57...

Do you have any simple examples of how this is done or links to a basic example for the XSLT transformation services?

Thanks CS
 
Back
Top