【发布时间】:2019-12-31 05:38:55
【问题描述】:
下面是我的 46 个 asp.net 控件,包括文本框和下拉列表,用于在单个按钮中插入数据
下面是我的 asp.net 控件 ID,如上图给定的图像
ddl_tag1 txt_date1 ddl_type1 txt_narration1 txt_amount1 txt_bill1 txt_fromloc1 txt_tolocation1
ddl_tag2 txt_date2 ddl_type2 txt_narration2 txt_amount2 txt_bill2 txt_fromloc2 txt_tolocation2
ddl_tag3 txt_date3 ddl_type3 txt_narration3 txt_amount3 txt_bill3 txt_fromloc3 txt_tolocation3
ddl_tag4 txt_date4 ddl_type4 txt_narration4 txt_amount4 txt_bill4 txt_fromloc4 txt_tolocation4
ddl_tag5 txt_date5 ddl_type5 txt_narration5 txt_amount5 txt_bill5 txt_fromloc5 txt_tolocation5
ddl_tag6 txt_date6 ddl_type6 txt_narration6 txt_amount6 txt_bill6 txt_fromloc6 txt_tolocation6
下面是我的表结构,上面六行数据一一插入到下面的格式中
Sno TAQ DATE TYPE NARRATION AMOUNT BILL FROM LOCATIOM TO LOCATION
使用添加按钮插入数据的最佳方法是什么,我必须使用每个循环插入上面的文本框,然后下拉插入一行,然后再插入另一行。
【问题讨论】:
-
你考虑过GridView吗?
标签: c# asp.net webforms ado.net