title: Using VB to retrieve the sum of a column of salaries from an Access database
body: <p>I have been sitting here with five other guys trying out how to total values from a column. We have scoured Google, but none of the code we've found works.</p>
  
  <p>Here is my form: </p>
  
  <p><img src="https://i.stack.imgur.com/mUIST.png" alt="form"></p>
  
  <p>Here is the code I have thus far:</p>
  
  <pre><code>Public Class frmTotal
      Dim dt As New DataTable()
      Dim rowindex As Integer = 0
      Dim connstr As String = "provider=microsoft.jet.oledb.4.0;" &amp; "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
  </code></pre>