Private Sub arrays(ByVal ss As DataTable, ByRef rr() As String, ByRef rr1()() As String, ByRef id() As Integer, ByRef attr()() As String) Dim cc As DataColumn Dim cr As DataRow Dim z As Integer Dim m As Integer Dim j As Integer Dim i As Integer Dim d As Integer Dim k As Integer k = 0 d = 0 j = 0 i = 0 z = 0 m = 0 For Each cc In ss.Columns ReDim Preserve rr(z) rr(z) = cc.Caption z += 1 Next Dim f As Integer = rr.Length - 1 For Each cc In ss.Columns For Each cr In ss.Rows ReDim Preserve rr1(k)(f)["IndexOutOfRangeException was unhandled"error ] rr1(k)(m) = cr(cc) k = k + 1 Next If m < f Then m = m + 1 End If k = 0 Next For Each cc In ss.Columns If cc.Caption = "ID" Then For Each cr In ss.Rows ReDim Preserve id(j) id(j) = cr(cc) j += 1 Next Else For Each cr In ss.Rows ReDim Preserve attr(rr1.GetUpperBound(0) - 1)(i) attr(d)(i) = cr(cc) If d < rr1.GetUpperBound(0) Then d += 1 End If Next d = 0 i += 1 End If Next End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)