各位老师新年好!
我在全局事件中,写下如下代码,请问如何才能避开已经生成的临时表“XJHHZLSHZB”,我在If e.DataTable.Name <> "WorkLogfile" Then后面跟上
If e.DataTable.name = "XJHHZLSHZB" Then
e.Cancel = True
End If
可是没有成功,请老师指教!!
If e.DataTable.Name <> "WorkLogfile" Then
If e.DataRow.RowState = 2 Then
Return
Else
Dim dr As DataRow = DataTables("WorkLogfile").AddNew
dr("ID") = e.DataRow("_Identify")
dr("用户") = _UserName
dr("涉及表") = e.DataTable.Name
dr("涉及列") = e.DataCol.Name
dr("涉及行") = e.DataRow("_Identify")
dr("时间") = Date.Now
dr("操作") = """" & e.OldValue & """ 改成了 """ & e.NewValue & """"
Dim str As String = ""
For Each c As DataCol In e.DataTable.DataCols
str += c.Name & "=" & e.DataRow(c.Name) & "|"
Next
dr("原行数据") = str
End If
End If