• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 623
  • Last Modified:

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
1 Solution
ds.Tables[0].Rows[0]["Column Name"].ToString()
Anurag ThakurCommented:
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()

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now