473,471 Members | 4,124 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Property List

I want to write a routine which will list all of the propetries and all
property names for a particular object, say a DataColumn. I there a way
for me to do this without manually looking up each property name and the
property value?
Thanks in advance for your assistance!!!!!!!!!!!
Nov 15 '05 #1
2 5220
Hi Jim,

You might take a look at reflection.
Type.GetProperties method is what you need.

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rhand.com

"Jim Heavey" <Ji*******@nospam.com> wrote in message
news:Xn*********************************@207.46.24 8.16...
I want to write a routine which will list all of the propetries and all
property names for a particular object, say a DataColumn. I there a way
for me to do this without manually looking up each property name and the
property value?
Thanks in advance for your assistance!!!!!!!!!!!

Nov 15 '05 #2
I suggest you take a look at the PropertyGrid control:
http://msdn.microsoft.com/library/de...ngpropgrid.asp
If you have used Microsoft® Visual Basic® or Microsoft Visual Studio .NET
then you have used a property browser to browse, view, and edit the
properties of one or more objects. The .NET Framework PropertyGrid control
is core to the property browser that is in Visual Studio .NET. The
PropertyGrid control displays properties for any object or type, and it
retrieves the item's properties, primarily using reflection. (Reflection is
a technology that provides type information at run time.)

Otherwise, if you want to do it all manually, you can use refelection:
object o;

foreach(System.Reflection.PropertyInfo pi in o.GetType().GetProperties())
{
MessageBox.Show(pi.Name);
}
object o;

foreach(System.Reflection.PropertyInfo pi in o.GetType().GetProperties())
{
MessageBox.Show(pi.Name);
}
--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
"Jim Heavey" <Ji*******@nospam.com> schreef in bericht
news:Xn*********************************@207.46.24 8.16...
I want to write a routine which will list all of the propetries and all
property names for a particular object, say a DataColumn. I there a way
for me to do this without manually looking up each property name and the
property value?
Thanks in advance for your assistance!!!!!!!!!!!

Nov 15 '05 #3

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

Similar topics

8
by: Vipin Kedia | last post by:
Hi I have written a code for showing the list boxes as selected using a Listitem and the selected property of the items. Now I have 2 list boxes in my page. But it shows only the selected values...
1
by: Georg Scholz | last post by:
Hello, The class "Control" contains a documented Property "ControlType". So for example, in a form, you can write code like this: Dim c as control set c = me.Controls("textbox1") if...
0
by: Jordan Bowness | last post by:
I make a similar post in another newsgroup, but this example is simplified somewhat. I have a component (cmpMyComponent) with 2 properties. The 1st property is a string value (Description) and...
6
by: Altman | last post by:
I would like to use an indexed property to access my private array of user controls. If I don't use an indexed property, the property will show up in my Properties Window during development. Is...
9
by: Paul | last post by:
Hi, I feel I'm going around circles on this one and would appreciate some other points of view. From a design / encapsulation point of view, what's the best practise for returning a private...
1
by: shapper | last post by:
Hello, I created a user control (.ascx) with a property as follows: Private _Messages As Generic.List(Of String) Public Property Messages() As Generic.List(Of String) Get Return _Messages...
1
by: shapper | last post by:
Hello, I have a class where I created various controls. One of the controls have a property which is a generic list of WebControl. Then in web site page I have something like: Dim a As New...
1
by: shapper | last post by:
Hello, I am creating a control which I will compile in a class. I am having problems when I use a property in the View State: ' Items <Bindable(True), Category("Data"), DefaultValue(""),...
3
by: shapper | last post by:
Hello, Is there a difference between defining a control property in the following two ways: ' Items ... Private _Items As Generic.List(Of ListItem) = New Generic.List(Of ListItem) ****...
1
by: dwillis | last post by:
ok will try again on this forum to bee clear i'm using vb.net 2005. so on to the problem i've search the net extensivly and can not find a clear example on how to acomplish what i'm trying to do....
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.