我和其他五个人坐在这里,尝试如何从列中汇总值。我们搜索了谷歌,但我们发现的代码都没有。
这是我的表格:
这是我到目前为止的代码:
Public Class frmTotal
Dim dt As New DataTable()
Dim rowindex As Integer = 0
Dim connstr As String = "provider=microsoft.jet.oledb.4.0;" & "data source=valleyfair.mdb"
Dim sqlstr As String = "select * from employee"
Private Sub btnTotal_Click(sender As System.Object, e As System.EventArgs) Handles btnTotal.Click
End Sub
Private Sub frmTotal_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
dt.Clear()
Dim dataAdapter As New OleDb.OleDbDataAdapter(sqlstr, connstr)
dataAdapter.Fill(dt)
dataAdapter.Dispose()
End Sub
End Class