c# - For Each SQL Insert change the box ID +1 -


in situation generating dynamic text box based on list box click capture data point, once done need each select , insert them individually database. issue follows.

we have

for each item in listbox --call sql connection-- @var = textbox1.text.tostring() 

upon next run (next each item) need code increase textbox1 textbox2.

any general thoughts on how accomplish this?

something

        int iterator = 1;          foreach (listboxitem item in yourlistbox.items)         {             textbox tbx = new textbox();             tbx.id = "textbox" + iterator.tostring();             //your sql operation              iterator++;          } 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -