Creating a loop that will edit 60 TextBox names?

前端 未结 4 1170
傲寒
傲寒 2021-01-26 05:27

text box set1 = 1 to 30 = in the query name = br1id to br30id

textbox set 2 = 1 to 30 = in the result output

i dont understand how to create a loop based on 30

4条回答
  •  爱一瞬间的悲伤
    2021-01-26 06:06

    You really should reconsider your design if you have 600 TextBox controls. Holy cow.

    Also, your SQL is very much subject to SQL injection.

    What you're looking to to specifically can't be done, as there is no dynamic evaluation of C# at runtime. What you need to do is create a collection of the controls you want to use--in the order you want to use them--then enumerate over this list to use in your query. However, this query should absolutely be rewritten to use parameters.

提交回复
热议问题