【接收数据参考】的案例中,是一组数据全部填充到表格的一行,
我需要达成的效果是,每一个数据(姓名、停权)单独生成一行,也就是上面图片中有6个数据,那就是在表B中生成6行,每一行记录一个数据(姓名、停权)。
现在卡在这里不知道怎么进行下去了,请蓝老师抽空点拨一下我?感谢您
Dim wb As New weui
Select Case e.Path
Case "test.htm"
wb.AddForm("","form1","accept.htm")
Dim dt As List(of DataRow) = DataTables("表A").SQLSelect("",8," 序号 desc ") '-------------------文章排序选前30
For i As Integer = 0 To dt.Count - 1 '开始从第一个新闻列表
With wb.AddInputGroup("form1","ipg1" & i & "","")
' .AddInput("姓名","" & dt(i)("姓名") & "","Text") '前一个"姓名"是ID,后一个"姓名"是标题
.AddSwitch("姓名" & i & "","" & dt(i)("姓名") & "").Value = "True"
End With
Dim nms() As String = {"" & dt(i)("姓名") & ""} '不能为空的列名数组
' MessageBox.Show("" & dt(i)("姓名") & "")
Dim dr As DataRow = DataTables("表B").AddNew()
For Each nm As String In nms
If e.PostValues.ContainsKey(nm) Then
dr("姓名") = "" & dt(i)("姓名") & ""
dr("停权") =e.PostValues(nm)
End If
Next
dr.save()
Next
With wb.AddMsgPage("","msgpage","增加成功", "好好学习,天天向上") '生成成功提示页
.AddButton("btn1","继续增加","test.htm")
End With
e.WriteString(wb.Build)
End Select
[此贴子已经被作者于2021/8/18 13:47:23编辑过]