473,397 Members | 1,949 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,397 software developers and data experts.

looping into a collection

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.

Nov 20 '05 #1
2 1307
Luc Trépanier <lu***********@etsmtl.ca> scripsit:
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
///

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
"Luc Trépanier" <lu***********@etsmtl.ca> schrieb
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.
--
Armin

Nov 20 '05 #3

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

Similar topics

1
by: Jozef | last post by:
Hello, I'm trying to loop through forms by doing a "For Each" in the Currentdb. I'm doing this like the following; Dim db as dao.database Dim docLoop as document Dim ctrl as control Set db...
45
by: Trevor Best | last post by:
I did a test once using a looping variable, first dimmed as Integer, then as Long. I found the Integer was quicker at looping. I knew this to be true back in the 16 bit days where the CPU's (80286)...
16
by: TD | last post by:
This is the code under a command button - Dim ctl As Control For Each ctl In Me.Controls If ctl.BackColor <> RGB(255, 255, 255) Then ctl.BackColor = RGB(255, 255, 255) End If Next ctl
1
by: Diva | last post by:
Hi, I have a data grid in my application. It has 20 rows and I have set the page size as 5. I have a Submit button on my form and when I click on Submit, I need to loop through the rows in the...
3
by: VB Programmer | last post by:
Here's the code: For Each li As ListItem In Me.lstAssignedEmailAddresses.Items If li.Selected = True Then Me.lstAssignedEmailAddresses.Items.Remove(li) End If Next When I remove an item I get...
10
by: Chet Cromer | last post by:
I am creating a set of base classes and sub classes to use throughout a program I'm developing. The base class represents a generic "lookup table" from my database that contains lists of things...
1
by: Peter Parker | last post by:
Does anyone know if there is a method or property in php5 that provides the collection size in XML processing? For example, $collection=$doc->getElementsByTagName("someTag"); where one can get...
7
by: Mick Walker | last post by:
I have a collection of objects populated from a SQL Server (sorted descending). Each of these object has a date field. I need a way to loop through these object starting from the newest entry,...
3
by: SAM | last post by:
ll a écrit : <script type="text/javascript"> function checkform( f ) // f is the form to check { var txt1 = 'Please make a selection for the Learning Outcome :', txt2 = '\nYour...
1
by: Sweetiecakes | last post by:
Hello Is there an example of looping through a dataset filling an array with it? Thank you
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.