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


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();

Please help
Who is Participating?
Anurag ThakurTechnical ManagerCommented:
i have modified the above post a little as i think you might want to loop the dataset table for each row to get the value
ds.Tables["TableName"].Rows[RowCount]["Column Name"].ToString()
ds.Tables[0].Rows[0]["Column Name"].ToString()
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.