views:

43

answers:

1

I've been researching to find out how and what to use to get say the name's of the fields in a class, then to invoke that class and get the properties of the class, as in the field values. Give you an example, Say if I one to get one value from one record from one table, I would create an object of that class as in;

DBTable<cars> cartable = new DBTable<cars>(1) //passing 1 is a dataset number
cartable.GetLastRec(); OR cartable.Attributes.Key.carIdx // record index
cartable.GetKeyRec();
// Now I print the value
Console.WriteLine("Car number: " + cartable.Attributes.Data.number;

It's easy to get one record, it's like an Object Orientated Database but not sure if it isn't, I don't have any knowledge of the database system, just that the classes are used to talk to a DLL file and pass some numbers.

so far I've been testing with collections, inheriting, ORM, and nothing seams to be able to describe the very simple process going on, Even dynamic invoking objects and iterating over it's attributes What I hope do is; Datagridview => Table Classes => DLL entry points => Database

If anyone has had the same challenge or maybe I have the wrong approach here, but completely lost at this stage, Any Idea's welcome Thanks in Advance

btw: I'm using VS2005, .NET 2.0

A: 

The only way to do this is by providing your own PropertyDescriptorCollection.

A search here or on Google, should point you in the correct direction.

leppie