looping into a collection

  • Thread starter Thread starter =?iso-8859-1?Q?Luc_Tr=E9panier?=
  • Start date Start date
?

=?iso-8859-1?Q?Luc_Tr=E9panier?=

Is there an easy way to loop through all properties of a
textbox for example because I want to be sure a particular
custom property exists?

The same question applies to SQlDataAdapter and DataSet in
a form. Is there a way to get all datasets and
sqldataadapters in the form without writing

"me.sqldataadapter1..."
"me.dataset1..."

I'd prefer to lopp through a collection or something like
that.

Any suggestion?

Thanks.

Luc.
 
Luc Trépanier said:
Is there an easy way to loop through all properties of a
textbox for example because I want to be sure a particular
custom property exists?

The same question applies to SQlDataAdapter and DataSet in
a form. Is there a way to get all datasets and
sqldataadapters in the form without writing

"me.sqldataadapter1..."
"me.dataset1..."

I'd prefer to lopp through a collection or something like
that.

Any suggestion?

Put them into an array/arraylist/collection once, later use a loop.
 
Luc Trépanier said:
Is there an easy way to loop through all properties of a
textbox for example because I want to be sure a particular
custom property exists?

\\\
Imports System.Reflection
..
..
..
Dim pi() As PropertyInfo = Me.GetType().GetProperties()
Dim p As PropertyInfo
For Each p In pi
MsgBox(p.Name)
Next m
///
 
Back
Top