Hi,
we can access a record in dataset by column name,or by index..but when we
implement collections using collectionbase we can do so by only index..how
can I add the feature of accessing using property name/value?
we have implemented find function like this..
'''''this function takes collection...in which to find the value based on
property name..
Friend Shared Function FindObject(ByVal propName As String, ByVal propValue
As Object, ByVal vCollection As CollectionBase, ByVal objType As Type) As
Object
Dim obj As Object
Dim prop As PropertyDescriptor
Try
prop = TypeDescriptor.GetProperties(objType).Find(propNam e, True)
For Each obj In vCollection
If prop.GetValue(obj) Is propValue Then
Return obj
End If
Next
Catch ex As Exception
MsgBox("Error:" & vbCr & ex.Message, MsgBoxStyle.Information,
"CollectionView.Find")
End Try
End Function
thks