|
-
May 21st, 2003, 04:19 PM
#1
Thread Starter
Lively Member
Parse dataset: resolved
Hey guys, I'm hoping someone could help me parse a dataset.. Below is the
non-syntanically corrct way of doing it, I'm hoping someone could translate
it from english to vb.net 
With each row in dataset do
with each column in dataset do
writeline("this is the data from this cell")
loop
loop
so it parses each cell, so if i have a dataset like this
1 2 3
4 5 6
7 8 9
it would parse, and pull data from 1, then 2, then 3, then 4, yada yada....
thanks!
Last edited by Iamthewalrus15; May 21st, 2003 at 05:36 PM.
-
May 21st, 2003, 04:31 PM
#2
Just do a couple nested for..each loops for the rows and columns collection of the dataset.
-
May 21st, 2003, 04:33 PM
#3
Thread Starter
Lively Member
hehe yes,, thats the code i wrote in english,, I'm trying to figure out how to write that in vb.net
-
May 21st, 2003, 05:12 PM
#4
PowerPoster
VB Code:
'Go through all the columns and rows.
'Putting the results in a string.
Dim myString As String
Dim dr1 As DataRow
For Each dr1 In MyDataSet.Tables(0).Rows
For i = 0 To 2 ' Column amount - 1 (I am using a column count of 3, but you can change this to the amount of your columns.
myString += dr1(i) + " - "
Next
Next
MessageBox.Show(myString)
-
May 21st, 2003, 05:35 PM
#5
Thread Starter
Lively Member
Beautiful,, tested, works like a charm
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|