I’m writing an app for someone where I am pulling in work orders table information. The information includes: worknum, fname, lname, customername, description, etc. I do not plan to update the data in this table, only to read from it.
I’d like to display a combo box for the work order numbers. The user would start typing the information for the work order in and it would autocomplete based on what’s in the list. As work orders are displayed in the combo box, I want to update the data in text boxes representing the various fields.
I’m thinking rather than query the database several times, it would be a good idea to create a DataSet with information for the work orders table within the last x months then query the data from that dataset. I know there is a DataSet.Select method, but it looks like it returns the entire row. Is it possible to retrieve just a column of distinct values? For example, I’d like to do a select statement similar to this:
SELECT worknum FROM {WorkOrderDataSet} WHERE date >'{today-x}
The first part in curly brackets is meant to represent the work order dataset I create when first importing the data from Access. The second part in curly brackets will be replaced with variable data to represent a date to reference. I also don’t think I’ll need distinct because the workorder is unique (edit: is a primary key)
Any suggestions/questions will be very appreciated.
Is it possible to retrieve just a column of distinct values from a DataSet with multiple columns? How do I do this?
For anyone else searching and coming across this, I found a solution that kind of works. I found the solution on another site:
The only drawback is that it displays all the data in the original datatable.
If anyone knows how to actually APPLY a fully qualified select statement against an existing DataTable OBJECT, please point me to some example code, because so far, I’ve yet to find this information. I understand SQL Select terminology, just not how to apply it to VB objects.
Thanks to Hand-E-Food for attempting to read the original post and answer. I apologize it wasn’t clear to you. I attempted to copy the question to the end of the post, but didn’t receive future answers.