Maven4Champ
Technical User
- Jun 16, 2004
- 154
All,
Receiving this error when trying to declare, and add to a dynamic array. I may be doing this wrong because arrays aren't my speciality AT ALL.
Here is the code I have so far:
Just as an FYI, dr and dv1 are already declared in earlier code. I am trying to just loop through the records and add to the array. The MSDN article(s) I found weren't much help so I am coming to the pros.
Let me know if you can assist.
Thanks!
Receiving this error when trying to declare, and add to a dynamic array. I may be doing this wrong because arrays aren't my speciality AT ALL.
Here is the code I have so far:
Code:
Dim x As Integer = 0
Dim excluded As String()
Dim excludedList As New ArrayList()
For Each dr As DataRowView In dv1
excludedList.Add(dv1.Table.Rows(x).Item(0).ToString())
x = x + 1
Next
excluded() = CType(excludedList.ToArray(GetType(String)), String())
Just as an FYI, dr and dv1 are already declared in earlier code. I am trying to just loop through the records and add to the array. The MSDN article(s) I found weren't much help so I am coming to the pros.
Let me know if you can assist.
Thanks!