on-internet
← Community

C# .NET Dynamic TextBox from SQL Results

Stack Overflow ·

I'm not usually one for asking questions but I am interested to see different ideas. I have a webforms app which I am looking to dynamically populate textboxes based on the query results. Basically if I query the below: SELECT Product_Field_ID, Product_ID, SortOrder, Name, Type FROM Product WHERE product_id = 100 I would get a results table as follows: I would add this to a datatable or IEnumerable interface and then iterate through a for each list dynamically creating the controls. For the purpose of this question I would use something like the below: int a; for (a = 0; a < dt.Rows.Count; a++

Comments

Sign in or sign up to comment and upvote.

No comments yet.