Easy Constructor

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Salsa_Dancer

    #1

    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.a dd(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.
  • Tim

    #2
    oops on Earlier Reply ! -- Easy Constructor

    instead use:




    int iMax = myDataSet.Table s["yourTableN ame"].Rows.Count;



    sorry about that.

    Comment

    • Yves Tourchot

      #3
      Re: Easy Constructor


      "Salsa_Danc er" <anonymous@disc ussions.microso ft.com> wrote in message
      news:00bd01c3b9 b4$925dd2a0$a10 1280a@phx.gbl.. .[color=blue]
      > Hi forum,
      >
      > I have this constructor inside a class that derives from
      > webcontrol
      >[/color]

      public example(int num)

      [color=blue]
      > 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.a dd(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.[/color]


      Comment

      Working...