新增的_Identify 还没有生成
循环完毕后保存表,然后用sql更新
If ListAnniu.Count > 0 Then
For Each List As object In ListAnniu
Dim dr As DataRow = dt.Find("控件名称 = '" & List.name & "'")
If dr Is Nothing Then
dr = dt.AddNew()
dr("窗体ID") = dtName.DataRows(0)("窗体ID")
dr("控件名称") = List.name
dr("权限控制") = False
'dr("控件ID") = dr("_Identify")
End If
dr("控件标题") = List.Text
dr("控件类型") = "按钮"
'dr("权限控制") = False
dr("删除") = False
dr("修改时间") = system_Mydate
' dr("权限类型") = ???
Next
dt.save
cmd.CommandText= "upd ate 窗体控件对应表 set [控件ID]=[_Identify] where [控件ID] is null"
cmd.ExecuteNonQuery
End If