469,962 Members | 2,208 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,962 developers. It's quick & easy.

Easy Constructor

Hi forum,

I have this constructor inside a class that derives from
webcontrol

public example()
{
for(int i=0;int<num;i++)
{
//MyGroup is an array of TextBoxes Property inside
//the class
this.MyGroup[i]=new TextBox();
this.Controls.add(this.MyGroup[i]);
}
}
My question is very easy... I would like to know hoy can i
manage the variable num in the loop... Cause i have
another class that returns to me a number of elements
depending of a query in a database... I would like to show
as many TextBoxes as results in my query...

Thanks to all.
Regards.
The Salsa Dancer.
Nov 15 '05 #1
2 2213
Tim
instead use:


int iMax = myDataSet.Tables["yourTableName"].Rows.Count;

sorry about that.
Nov 15 '05 #2

"Salsa_Dancer" <an*******@discussions.microsoft.com> wrote in message
news:00****************************@phx.gbl...
Hi forum,

I have this constructor inside a class that derives from
webcontrol

public example(int num)

public example()
{
for(int i=0;int<num;i++)
{
//MyGroup is an array of TextBoxes Property inside
//the class
this.MyGroup[i]=new TextBox();
this.Controls.add(this.MyGroup[i]);
}
}
My question is very easy... I would like to know hoy can i
manage the variable num in the loop... Cause i have
another class that returns to me a number of elements
depending of a query in a database... I would like to show
as many TextBoxes as results in my query...

Thanks to all.
Regards.
The Salsa Dancer.

Nov 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Jun | last post: by
15 posts views Thread by A | last post: by
2 posts views Thread by jm | last post: by
45 posts views Thread by Ben Blank | last post: by
10 posts views Thread by Brian | last post: by
74 posts views Thread by Zytan | last post: by
reply views Thread by TonyJ | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.