If e.DataCol.Name = "HTH" Then
Dim filter As String = "HTH = '" & e.DataRow("HTH") & "'And 年度 = '" & e.DataRow("年度") & "'"
e.DataRow("本金本年增加") = DataTables("DKFKB").Compute("sum(XFJE)",filter)
e.DataRow("本金本年减少") = DataTables("HBFX").Compute("sum(BJ)",filter)
End If
If e.DataCol.Name = "HTH" Then
Dim filter1 As String
Dim filter2 As String = "HTH = '" & e.DataRow("HTH") & "'And 年度 = '" & e.DataRow("年度") & "'"
e.DataRow("一季度利息") = DataTables("支付利息").Compute("sum(LX)",filter2 And filter1 = "一季度")
e.DataRow("二季度利息") = DataTables("支付利息").Compute("sum(LX)",filter2 And filter1 = "二季度")
e.DataRow("三季度利息") = DataTables("支付利息").Compute("sum(LX)",filter2 And filter1 = "三季度")
e.DataRow("四季度利息") = DataTables("支付利息").Compute("sum(LX)",filter2 And filter1 = "四季度")
End If
If e.DataCol.Name = "HTH" Then
Dim filter As String = "HTH = '" & e.DataRow("HTH") & "'And 年度 < '" & e.DataRow("年度") & "'"
e.DataRow("本金年初余额") = DataTables("DKFKB").Compute("sum(XFJE)",filter) - e.DataRow("本金本年减少") = DataTables("HBFX").Compute("sum(BJ)",filter)
End If
老师,上述代码执行后提示以下错误:是什么错误呢,是数据类型错误吗?Conversion from string "HTH = '0002'And 年度 = '2015'" to type 'Boolean' is not valid
麻烦老师帮我看看是什么错误,谢谢!!
.NET Framework 版本:2.0.50727.3655
Foxtable 版本:2015.11.2.1
错误所在事件:表,DKHTB, DataColChanged
详细错误信息:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidCastException: Conversion from string "HTH = '0002'And 年度 = '2015'" to type 'Boolean' is not valid. ---> System.FormatException: Input string was not in a correct format.
at Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String Value, NumberFormatInfo NumberFormat)
at Microsoft.VisualBasic.CompilerServices.Conversions.ToBoolean(String Value)
--- End of inner exception stack trace ---
at Microsoft.VisualBasic.CompilerServices.Conversions.ToBoolean(String Value)
at UserCode.DataColChanged(DataColEventArgs e)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Foxtable.DataTable.oo0_o_o_(DataCol A_0)
[此贴子已经被作者于2016/1/25 17:51:55编辑过]