I current have this code, when the button is clicked nothing happens. I suspect I'm either missing a connections or it's just entirely wrong. The DB is CalcDB, table is CalcOps, column is Operation. Needs to pull all of the rows into the list box.
Dim Builder As New OleDb.OleDbConnectionStringBuilder With
{
.Provider = "Microsoft.ACE.OLEDB.12.0",
.DataSource = IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "CalcDB"),
.PersistSecurityInfo = False
}
Try
Using cn As New OleDb.OleDbConnection With {.ConnectionString = Builder.ConnectionString}
Using cmd As New OleDb.OleDbCommand With {.Connection = cn}
cn.Open()
Dim comm As New OleDbCommand("SELECT Operation FROM CalcOps", cn)
comm.CommandType = CommandType.StoredProcedure
Dim da As New OleDbDataAdapter(comm)
Dim ds As New DataSet
da.Fill(ds)
ListBox1.Items.Clear()
If ds.Tables.Count > 0 And ds.Tables(0).Rows.Count > 0 Then
ListBox1.DataSource = ds
End If
End Using
End Using
Catch ex As Exception
End Try
End Sub