有人帮助我。我希望按每日,每周和每月在datagridview中显示数据,并在InstallmentAmount列上计算总金额。 请帮忙
答案 0 :(得分:0)
请查看Snap。
这是代码,
Dim ds As DataSet = New DataSet
Dim da As OleDbDataAdapter
Dim tables As DataTableCollection = ds.Tables
Dim source1 As New BindingSource()
da = New OleDbDataAdapter("Select [InstallmentDate], [CustomerID], [CustomerName], [InstallmentNumber], [InstallmentAmount] from VoucherEntrytbl", conn)
da.Fill(ds, "VoucherEntrytbl")
Dim view1 As New DataView(tables(0))
source1.DataSource = view1
dgvBSDaily.DataSource = view1
dgvBSDaily.Refresh()
source1.Filter = DateTimePicker3.Value.Date
DataGridView1.Refresh()