I'm trying to figure out how to retrieve and display data from MS Access to my project's DataGridView. So far I have the codes to make the options for the CheckedListBox appear.
(Codes for other categories are not included since they're all basically the same)
'view client items connectionString = "provider=microsoft.jet.oledb.4.0;data source=|datadirectory|\invdata.mdb;" Dim ds1 As New DataSet Dim sql1 As String = "select Client from NTIdb" 'dim dif as integer cnn = New OleDbConnection(connectionString) Try cnn.Open() adptr = New OleDbDataAdapter(sql1, cnn) adptr.Fill(ds1) For a = 0 To ds1.Tables(0).Rows.Count - 1 CheckedListBox2.Items.Add(ds1.Tables(0).Rows(a).Item(0)) Next adptr.Dispose() cnn.Close() Catch ex As Exception MsgBox(ex.ToString) End Try
And it would look like this:
What I want to achieve is to have the user check from the options (e.g Demo + Uru +Akai, etc..) from each categories (e.g Client, Status, Brand, etc..) and have it display on a DataGridView once the Filter button is clicked.
The other problem is the duplication of options. When the user adds multiple entries with the same value (from my Data Entry form which I did not include here), the same value appears in the CheckedListBox and I want to avoid that. I've been trying out stuffs but it doesn't seem to work.
Are my problems even possible to meet a solution? Or do you guys have any idea how to make it work?