How to get data from the dataset???

  • Thread starter Thread starter Gene
  • Start date Start date
G

Gene

if i have already fill the dataset,
but how can i get the data from it???
for example, I want to get the specific column and the specific data, what
should i do???
THX!!!
 
Hi Gene,

It is basicly very simple.

ds.tables(0).rows(0).item(0)

gives you the first item (column) from the first row in the first table.

one more, the same can also be written as (the text are of course your
names)

ds.tables("mytable").rows(0)("myfirstcolumn")

I use mostly the above ones, but there are hundreds of other methods.

(And if you use the desinger generated dataset, you get even a class, that
lets you get the data using functions).

I hope this helps?

Cor
 
Hi Gene,

I think what you are really asking is 'how can I find a particular column
value?' There are several solutions, but they are different than they were
under vb 6. Here's one way, by setting up a dataview in a specific order:
Dim arrayseeks(0) As Object

Dim ifinds As Integer

Dim vues As New DataView(dsshipcode.Tables(0))

vues.Sort = "shipcode"

arrayseeks(0) = "04" ' the shipcode I am looking for

ifinds = vues.Find(arrayseeks)

If ifinds <> -1 Then ' ie, found it

mdescrip = vues(ifinds)("descrip")

Else

mdescrip = ""

End If

HTH,

Bernie Yaeger
 
Thx guys!!!

Bernie Yaeger said:
Hi Gene,

I think what you are really asking is 'how can I find a particular column
value?' There are several solutions, but they are different than they were
under vb 6. Here's one way, by setting up a dataview in a specific order:
Dim arrayseeks(0) As Object

Dim ifinds As Integer

Dim vues As New DataView(dsshipcode.Tables(0))

vues.Sort = "shipcode"

arrayseeks(0) = "04" ' the shipcode I am looking for

ifinds = vues.Find(arrayseeks)

If ifinds <> -1 Then ' ie, found it

mdescrip = vues(ifinds)("descrip")

Else

mdescrip = ""

End If

HTH,

Bernie Yaeger
 
Back
Top