I'm trying to calculate a column from a database called rogaine.mdb.
I've been using an SQL statement to do this as I only want to calculate the points for certain teams. This is the code I've been using:
Dim teams As DataTable
Dim da As OleDb.OleDbDataAdapter
Dim sql, connStr, teamName As String
connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = "
connStr = connStr & "rogaine.mdb"
teamName = lstTeams.SelectedItem
sql = "SELECT SUM control " & _
"FROM controlVisits " & _
"WHERE team = teamName "
da = New OleDb.OleDbDataAdapter(sql, connStr)
teams = New DataTable
What I'm unsure and having trouble doing is to get the result displayed in a label after the calculation button has been clicked. Any advice would be alot of help thanks.