Link to home
Start Free TrialLog in
Avatar of aspgeek
aspgeek

asked on

How to assign value from the Dataset to the textbox in a Textbox array

HI,

I have created a textbox array. Now i need to dynamically create textboxes and then assign the values in the dataset to the textboxes.  and then teh textboxes to the HTML cells .

I am getting an error here  when i am assigning the value in teh DS to the textbpox

 foreach (TextBox curcotrl in txt_bx)
           {
                HtmlTableRow htr_rowctrl = new HtmlTableRow();
            HtmlTableCell htc_ctrlctrl = new HtmlTableCell();
           string ctrltype = row["DATA_TYPE"].ToString();
              txt_bx.Text = row["DATA_TYPE"].ToString();
               htc_ctrlctrl.Controls.Add(curcotrl);
               htr_rowctrl.Cells.Add(htc_ctrlctrl);
               controls.Controls.Add(htr_rowctrl);
           }

Please help
Avatar of HarryNS
HarryNS

ds.Tables[0].Rows[0]["Column Name"].ToString()
ASKER CERTIFIED SOLUTION
Avatar of Anurag Thakur
Anurag Thakur
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial