报错这样处理
Dim str As String
Dim id As Integer
id = user.name.IndexOf("@")
str = user.name.SubString(0,id)
Dim lts As List(of DataRow) = DataTables("盖楼").SQLSelect("回复者 like '%" & str & "%' And 备注 Is Not null And 提交 = 0 ")
For Each lt As DataRow In lts
lt("提交") = True
If e.form.controls.contains("TextBox" & lt("_Identify")) Then
e.Form.Controls("TextBox" & lt("_Identify")).ReadOnly = BooleanEnum.True
End If
If e.form.controls.contains("label2" & lt("_Identify")) Then
e.Form.Controls("label2" & lt("_Identify")).text = Date.now
End If
lt.Locked = True
lt.save
Next
DataTables("盖楼").SQLUpdate(lts)
另外,你应该单独做一个刷新按钮,也就是删除所有新增的控件,根据表内容重新生成最新的内容。
[此贴子已经被作者于2016/3/17 17:53:25编辑过]