.NET Framework 版本:2.0.50727.5485
Foxtable 版本:2014.11.11.1
错误所在事件:表,kucun,DataColChanged
详细错误信息:
调用的目标发生了异常。
语法错误:“s”运算符后缺少操作数。
代码如下, 但是好像我的字段里 没有s 这个命名啊
Select Case e.DataCol.Name
Case "name","in","xiaoshou","jie","chuanhuo"
Dim dr As DataRow
Dim mr As DataRow = e.DataRow
Dim drs As List(of DataRow)
dr = e.DataTable.Find("[_SortKey] < " & mr("_SortKey") & " And [name] = '" & mr("name") & "'", "[_SortKey] Desc")
If dr Is Nothing Then
mr("kucun") = mr("in") - mr("xiaoshou") - mr("chuanhuo") + mr("jieru") - mr("weixin") + mr("weixin1") - mr("jiechu") + mr("tui")
dr = mr
End If
drs = e.DataTable.Select("[_SortKey] >= " & dr("_SortKey") & " And [name] = '" & dr("name") & "'", "[_SortKey]")
For i As Integer = 1 To drs.Count - 1
drs(i)("kucun") = drs(i-1)("kucun") + drs(i)("in") - drs(i)("xiaoshou") + drs(i)("jie") -drs(i)("chuanhuo")
drs(i)("oldkucun") = drs(i-1)("kucun")
Next
If e.DataCol.Name = "name" AndAlso e.OldValue IsNot Nothing AndAlso e.OldValue <> e.NewValue Then
dr = e.DataTable.Find("[_SortKey] < " & mr("_SortKey") & " And [name] = '" & e.OldValue & "'", "[_SortKey] Desc")
If dr Is Nothing Then
dr = e.DataTable.Find("[name] = '" & e.OldValue & "'", "[_SortKey]")
If dr IsNot Nothing Then
dr("kucun") = dr("in") - dr("xiaoshou")+ dr("jieru") -dr("chuanhuo") - dr("tui") - dr("jiechu") + dr("chuanru") - dr("weixin")+ dr("weixin1")
End If
End If
If dr IsNot Nothing Then
drs = e.DataTable.Select("[_SortKey] >= " & dr("_SortKey") & " And [name] = '" & dr("name") & "'", "[_SortKey]")
For i As Integer = 1 To drs.Count - 1
drs(i)("kucun") = drs(i-1)("kucun") + drs(i)("in") - drs(i)("xiaoshou")+ drs(i)("jieru") -drs(i)("chuanhuo")+ drs(i)("jiechu") + drs(i)("chuanru") + drs(i)("weixin1") -drs(i)("weixin")
drs(i)("oldkucun") = drs(i-1)("kucun")
Next
End If
End If
End Select