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

Posted on 2009-04-28
Last Modified: 2013-12-17

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
Question by:aspgeek
    LVL 6

    Expert Comment

    ds.Tables[0].Rows[0]["Column Name"].ToString()
    LVL 26

    Accepted Solution

    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

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now