J
joshfeingold
I am trying to get data from a MySQL database which I will then
populate a listbox with. Here is my current code:
'get data from database
Dim strConn As String
strConn = "Provider=MySqlProv.3.0;Data
Source=allstaffcontact;Location=localhost;User
ID=whatever;Password=whatever;Persist Security Info=False;"
Dim sql As String
sql = "SELECT * from contactdetail"
Dim da As New Data.OleDb.OleDbDataAdapter(sql, strConn)
Dim ds As New System.Data.DataSet("contactDetails")
da.Fill(ds, "contactDetails")
'fill list box
lstProspects.DataSource = ds.Tables("contactdetail")
lstProspects.DisplayMember = "lastName"
When I run the code, nothing is returned. Can someone suggest why that
might be? I was thinking that perhaps the dataset was empty, but maybe
I am doing something wrong.
TIA,
Josh
populate a listbox with. Here is my current code:
'get data from database
Dim strConn As String
strConn = "Provider=MySqlProv.3.0;Data
Source=allstaffcontact;Location=localhost;User
ID=whatever;Password=whatever;Persist Security Info=False;"
Dim sql As String
sql = "SELECT * from contactdetail"
Dim da As New Data.OleDb.OleDbDataAdapter(sql, strConn)
Dim ds As New System.Data.DataSet("contactDetails")
da.Fill(ds, "contactDetails")
'fill list box
lstProspects.DataSource = ds.Tables("contactdetail")
lstProspects.DisplayMember = "lastName"
When I run the code, nothing is returned. Can someone suggest why that
might be? I was thinking that perhaps the dataset was empty, but maybe
I am doing something wrong.
TIA,
Josh