老师,下面代码运行出错,请帮忙看看哪里有问题,谢谢!
Dim dtb As New DataTableBuilder("现金收支明细")
dtb.AddDef("科目", Gettype(String))
dtb.AddDef("收入金额", Gettype(Double))
dtb.AddDef("支出金额", Gettype(Double))
dtb.AddDef("余额", Gettype(Double))
dtb.AddDef("单数", Gettype(Integer))
dtb.Build()
Dim y As Integer = e.Form.Controls("TextBox1").Text
Dim m As Integer = e.Form.Controls("TextBox2").Text
Dim dt1 As New Date(y, m, 1)
Dim dt2 As New Date(y, m, Date.DaysInMonth(y, m)) '获取本月的最后一天
Dim zsr As Double
Dim zzc As Double
zsr = DataTables("现金收入明细").SQLCompute("Sum(金额)", "日期 < #" & dt1 & "#")
zzc = DataTables("现金支出明细").SQLCompute("Sum(金额)", "日期 < #" & dt1 & "#")
Dim dr0 As DataRow = DataTables("现金收支明细").AddNew()
dr0("科目") = "上月余额"
dr0("余额") = zsr - zzc
Tables("现金收支_Table3").DataSource = dtb.BuildDataSource()
Tables("现金收支_Table3").SetColVisibleWidth("科目|150|收入金额|100|支出金额|100|余额|100|单数|50")