Dim oldV = args(0)
Dim newV = args(1)
Dim r As Row = CurrentTable.Current
Dim colIndex As Integer = CurrentTable.ColSel
Dim colName As String = CurrentTable.Cols(colIndex).Name
For Each dt As DataTable In DataTables
For Each dCol As DataCol In dt.DataCols
If dCol.Name = colName Then
For Each dr As DataRow In dt.Select("[" & colName & "] = '" & oldV & "'")
dr(colName) = newV
Next
End If
Next
dt.Save
Next
这段代码,执行后会显示数据类型转换错误,具体状况如下,不知道如何修改。
---------------------------
错误
---------------------------
自定义函数"同步更新数据函数"执行出错,错误信息如下:
System.Data.EvaluateException: 无法在 System.Decimal 和 System.String 上执行“=”操作。
在 System.Data.BinaryNode.SetTypeMismatchError(Int32 op, Type left, Type right)
在 System.Data.BinaryNode.BinaryCompare(Object vLeft, Object vRight, StorageType resultType, Int32 op, CompareInfo comparer)
在 System.Data.Select.Eval(BinaryNode expr, DataRow row, DataRowVersion version)
在 System.Data.Select.Evaluate(Int32 record)
在 System.Data.Select.FindFirstMatchingRecord()
在 System.Data.Select.GetBinaryFilteredRecords()
在 System.Data.Select.SelectRows()
在 System.Data.DataTable.Select(String filterExpression, String sort, DataViewRowState recordStates)
在 Foxtable.DataTable.Select(String filterExpression, String Sort, DataViewRowState RowState)
在 Foxtable.DataTable.Select(String filterExpression)
在 UserCode.A0mHatAwMtDcXrvv4(Object[] Args)
---------------------------
确定
---------------------------