I’ve been handed an Access database with 3 columns: Name, category, e-mail. What I’m trying to do is get out, as strings, all of the e-mails that match a given category.
I have a slight understanding SQL as I’m in the process of learning it. I’ve managed to churn out this bit of code, which populates a visual grid with the first names
Dim comm As New OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=.\AddressBook.mdb")
Dim addda As New OleDbDataAdapter("SELECT FirstName FROM Contacts", comm)
Dim dd As New DataTable("Name")
addda.Fill(dd)
DataGridView2.DataSource = dd
So I feel I’m getting fairly close, but I can’t figure out how to get that list of first names to go into a string (or array of strings). All of the online tutorials and books I find seem to go over just displaying the data in a dataview.
Point in the right direction?
try this:
The Using format will automatically dispose of your data objects.