How to find data with generics list in VB.NET (Write code).

 Posted by Bhakti on 11/19/2009 | Category: VB.NET Interview questions | Views: 7419

In the code example below, the function “FindData” will return list(“sublist”) of the objects having matchingKey same as viewstate value.

Dim sublist As List(Of MyClass)

sublist = allClient.FindAll(AddressOf FindData) ‘sublist will contain objects matching specified matching condition

Function FindData(ByVal b As MyClass) _
As Boolean
If (b.matchingKey = CInt(ViewState("matchingKey "))) Then ‘matching condition
Return True
Return False
End If
End Function

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response