Click here to Skip to main content
16,004,653 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
dear all,

i have a address list.
in this list i want to filter only 0 or 1 index value.
how to filter

For Each objAddress As CRAddressDetails In AddressList <br />
<br />
//here i want to select addressl list 0 index<br />
<br />
next<br />


Please help about this.



thanks
Posted

Don;t use For Each...
VB
For index As Integer = 0 To 1
    Dim objAddress As CRAddressDetails = AddressList(index)
    ...
Next
 
Share this answer
 
hi,

what kind for AddressList?
CRAddressDetails[]? ArrayList? List<craddressdetails>? Dictionary?

outside foreach cycle you can write:

VB
Dim zeroindex as CRAddressDetails = AddressList(0)
For Each objAddress As CRAddressDetails In AddressList 
 
    //here you can use zeroindex 

next
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900