G Guest Jan 10, 2006 #1 hey all, what's the best way to get records in a dataset into an array? Thanks, rodchar
C Chris Jan 10, 2006 #2 rodchar said: hey all, what's the best way to get records in a dataset into an array? Thanks, rodchar Click to expand... 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
rodchar said: hey all, what's the best way to get records in a dataset into an array? Thanks, rodchar Click to expand... 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
R Ron Dahl Jan 11, 2006 #3 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
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
C Cor Ligthert [MVP] Jan 11, 2006 #4 Rodchar, A dataset cannot hold anything except datatables. Can you be a little bit more clear? Cor
A Armin Zingler Jan 11, 2006 #5 rodchar said: hey all, what's the best way to get records in a dataset into an array? Click to expand... Dunno if this helps: Dim a As DataRow() ReDim a(dt.Rows.Count - 1) DirectCast(dt.Rows, ICollection).CopyTo(a, 0) Armin
rodchar said: hey all, what's the best way to get records in a dataset into an array? Click to expand... Dunno if this helps: Dim a As DataRow() ReDim a(dt.Rows.Count - 1) DirectCast(dt.Rows, ICollection).CopyTo(a, 0) Armin