Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Navigate Through Datasets

I want to navigate through 2 diffrent datasets.Like we do in VB 6
if not rs1.eof then
st = "select * from emp_master where emp_code='" & rs1(0) & "'"
set rs2= db.openrecordset(st)
end if

can anyone help me out to do the same thing in VB.Net

Thanx in advance.

Santosh.

Comments

  • raymcdraymcd Member Posts: 284
    : I want to navigate through 2 diffrent datasets.Like we do in VB 6
    : if not rs1.eof then
    : st = "select * from emp_master where emp_code='" & rs1(0) & "'"
    : set rs2= db.openrecordset(st)
    : end if
    :
    : can anyone help me out to do the same thing in VB.Net
    :
    : Thanx in advance.
    :
    : Santosh.
    :

    It's more like looping through a collection than looping through a recordset. It would look like the following...

    -dim x as datarow
    -for each x in dataset.datatables(0).rows
    - 'do whatever with datarow x...
    -next
    -

    If you can, use a datareader for looping through data. Quick and easy. looks like...

    do while datareader.read()
    . x = datareader.GetString(0) 'this is if the first col is string datatype
    loop

    -Ray
Sign In or Register to comment.