Hi all,
Is it possible for me to Construct an ENUM from a ResultSet returned from a Database. For example, I want the following ENUM...
/// <summary>
/// A list of all filter types, Status.
/// </summary>
public enum StatusFilter
{
All = 0,
Open = 1,
Complete = 2,
Unfinished = 3
}
Where I want this to be identical to what is returned from my Status's Lookup table, where I have four entries (along with their primary keys).
Basically, what I want, is to be-able to filter rows in a ListView by clicking on a specific ColumnHeader on the ListView. So effectively I want to be able to cycle through the status' (one click, show 'All' rows, next click show 'Open' rows etc). I am guessing using an ENUM is the best way to do this, but probs not :)
Am I going about the right way of doing this, or is there a better way
Thanks
Tryst

Constructing an ENUM from a simple ResultSet
anothernewVBguy
You can load the status into an array or datatable, we can also get the status from them one by one.
Luke
Harry 4531
You should simply select the Status's Lookup table into a DataSet and bind it to the control of your choice.
An enumeration would not be a wise choice, since it's static and has to be created before your code is even compiled, let alone run.
Hope this helps.
zumrut
Hello,
I think the DataView should be able to work for you in this issue. You can get the results into a dataset/datatable, and generate a dataview based on the the datatable. When User click the header, you can set the dataview's filter so that only part of statuses will be displayed.
How do you think it
Luke
katykaty
I don't need to bind this to a control, as I am not showing the data. I just want my application to know what to search on Next when a Column header is clicked, therefore, I need some ref/thing in my app to know what is next to search on.
Thanks
Tryst