array in dataset

  • Thread starter Thread starter Guest
  • Start date Start date
rodchar said:
hey all,

what's the best way to get records in a dataset into an array?

Thanks,
rodchar

Isn't it already?

If you take the datatable that is inside the dataset, it is just an
array or datarows.

DataTable.Rows(Y)(X)

Chris
 
Rod, I use a loop structure similar to:
For i = 0 To myDataSet.Tables(0).Rows.Count

For j = 0 To myDataSet.Tables(0).Columns.Count

If IsDBNull(myDataSet.Tables(0).Rows(i)(j)) = False Then

myarray(i, j) = myDataSet.Tables(0).Rows(i)(j)

End If

Next j

Next i

Ron Dahl
 
Rodchar,

A dataset cannot hold anything except datatables. Can you be a little bit
more clear?

Cor
 
rodchar said:
hey all,

what's the best way to get records in a dataset into an array?


Dunno if this helps:

Dim a As DataRow()

ReDim a(dt.Rows.Count - 1)

DirectCast(dt.Rows, ICollection).CopyTo(a, 0)



Armin
 
Back
Top