473,320 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

collections like dataset

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
Dec 14 '05 #1
0 887

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: womber | last post by:
I am getting XML from a dataset that has been populated via a storedprocedure no schemas have been applied nor any relationships. But the correct table names have been given to match the table(s)...
1
by: jac | last post by:
Hey, Newbie in using ADO.NET. What I do now : I read the database with an OleDbDataReader. For each row I read I make an object (let say Person + that object contains a collection with the...
0
by: Craig | last post by:
Does anyone know whether you can take a dataset and serialise into a custom collection? Over the past couple of months I've been retreiving my datasets and manually iterating them to create my...
1
by: Fabrizio | last post by:
Hi I'm Fabrizio and I come from Turin in Italy. I'm a new user of C# until now I program only in Java or sometimes in C. I've problem because the C# collections are different and I don't...
7
by: rodchar | last post by:
hey all, i was checking out time tracker on asp.net one of the starter kit projects. i was wondering why the users datagrid gets loaded the way does. first it pulls all the users in from a...
3
by: Paul | last post by:
Hello, I'm upgrading a small single user app to VB.NET and have a few questions about loading classes & collections classes with the data from a one to many dataset structure. I'm serializing...
4
by: John Dalberg | last post by:
I noticed the starterkits timetracker & issue tracker load data from a database into custom collections (arraylists) which bind to a datagrid. What are the advantages of using custom collections...
5
by: M Harris | last post by:
We are developing an application (using .Net in MS Studio 2003 using the Access jet engine as a backend) that is doing quite a bit of number crunching. The first part of the application was...
4
by: xlar54 | last post by:
Hey folks, Im working on a project, and of course am modelling the objects with the database later in mind. I have a question about collections and how they should be best used. Lets take for...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.