Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • *Experts*
Posted

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 you're doing the same changes, just in a different order,

there should not be a noticeable difference in speed.

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...