Jamie Fellrath
asked on
Trying to search arrayList "fields" and return Index
Hi everyone,
I've got an ArrayList that has been populated with objects defined in our business logic, using data returned from a SQL Stored Procedure. The app I'm working in is developed in VB.NET 2.0 (yes, I know. :) ).
I'm trying to figure out how to search through that ArrayList for a specific substring of characters in one "field" from the objects in the ArrayList, return the index of that item, and then remove it from the ArrayList.
I was trying something like this:
The problem I'm getting is that nothing is being returned, and I verified that there should be something returned based on the data from the Stored Procedure.
Where am I going wrong?
Changing the datatype of the Object returning the ArrayList is, unfortunately, not an option here.
I've got an ArrayList that has been populated with objects defined in our business logic, using data returned from a SQL Stored Procedure. The app I'm working in is developed in VB.NET 2.0 (yes, I know. :) ).
I'm trying to figure out how to search through that ArrayList for a specific substring of characters in one "field" from the objects in the ArrayList, return the index of that item, and then remove it from the ArrayList.
I was trying something like this:
For i As Integer = 0 To oAcc.FundList.Count - 1
If oAcc.FundList.Item(i).OptionCode.ToString().Substring(0, 2) = "CD" Then
oAcc.FundList.RemoveAt(i)
End If
Next
Where oAcc.FundList() is my ArrayList and OptionCode is one of the fields in the object contained in oAcc.FundList().The problem I'm getting is that nothing is being returned, and I verified that there should be something returned based on the data from the Stored Procedure.
Where am I going wrong?
Changing the datatype of the Object returning the ArrayList is, unfortunately, not an option here.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER