How to Query (select) ADO.NET Recordset

Hello,
I have a question about the best way to retrieve and query records in memory. Below is the sample of the data. Basically what I want to do is:

If a user picks a repcode from a dropdown is pick all the condcodes associated and populate a different combobox. Then when the user picks a condcode from the next dropdown dropdown populate another combobox with the associated simcodes.

Normally I would just run a series of queries to get the next set of rows. But this form will be used with a high frequency and I am trying to minimize the DB calls.

I am open to any ideas on this, collections, datatables, etc.

Thanks for your help and attention.
data-sample.jpg
fullbuggAsked:
Who is Participating?
 
CodeCruiserConnect With a Mentor Commented:
If you have data in one datatable and another datatable containing the records then

Combobox1.SelectedIndexChange:

dTable.DefaultView.RowFilter = "condcode='" & combobox1.Text & "'"

combobox2.DisplayMember = "Simcode"
combobox2.ValueMember = "Simcode"
combobox2.DataSource = dTable.DefaultView
0
 
Alfred A.Connect With a Mentor Commented:
Hi,

In my opinion, the use of DataTables in a DataSet would be one approach I would do.

You can use DataTables.Select Method to filter and retrieve information from memory rather than DB access.

http://www.akadia.com/services/dotnet_filter_sort.html

You can also use a generic list and store it in your dataset.

I hope this helps.
0
 
fullbuggAuthor Commented:
I agree... Would you happen to have a VB.NET version?
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
Alfred A.Commented:
0
 
fullbuggAuthor Commented:
Sorry about the delay in getting to this. I only get one day a week to write any code for this project.

Thanks again!
0
 
CodeCruiserCommented:
Would you explain the grade please?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.