老师,列字段出现%符号就报错。
.NET Framework 版本:2.0.50727.8762
Foxtable 版本:2017.4.22.1
错误所在事件:表,表A, DataColChanged
详细错误信息:
调用的目标发生了异常。
Like 运算符中出错: 字符串模式“XJ-123%-wsd-%”无效。
Select e.DataCol.Name
Case "商品名称","型号","规格"
If e.DataRow.IsNull("商品名称") OrElse e.DataRow.Isnull("型号") OrElse e.DataRow.Isnull("规格") Then
e.DataRow("商品ID") = Nothing
Else
Dim lb As String = getpy(e.DataRow("商品名称"), True).toupper & "-" & e.DataRow("型号") & "-" & e.DataRow("规格") & "-"
Dim max As String = e.DataTable.Compute("Max(商品ID)","商品id like '" & lb & "%' And _Identify<> '" & e.DataRow("_Identify") & "'") '取得该类别的最大编号
Dim idx = 1
If max > "" Then
idx = cint(max.SubString(lb.length))+1
End If
e.DataRow("商品ID") = lb & format(idx, "00000")
End If
End Select