Is this the best way to approach a distinct list of strings from my database in order to fill my MRU list? I do have a PartsBO...is there a way to get these strings from the BO? Also, the list is filled in descending alphabetical order, even though I have specified an ASC sort in the query. Is there a reason why my sort is backwards?
Thanks for any help on this!!Bill
I only have the one textbox that I have been asked to supply a MRU-type list. The users wanted to pick from all of the decriptions that are on file so that they can be consistent in their naming. What I have provided on this one control works; however, it just seems clumsy to me. Well, I may re-approach this topic if other users start requesting the same thing.
Two last thoughts...1) Could my code be streamlined any? I am not that great at manipulating datasets and collections; and, 2) I'd like to refill this list whenever a record is added/deleted/changed. Code I put the code in the AfterSave() method and it would work for all three operations?
Thanks a ton!Bill
//-- Create the commandcmd = new SqlCommand("SELECT DISTINCT partdesc FROM PartsMaster WHERE divisionindex = @division AND inactive = 0 ORDER BY partdesc");
//-- Create the parmscmd.Parameters.AddWithValue("@division", mADUser.LocationIndex).SqlDbType = System.Data.SqlDbType.Int;
//-- Execute the query and get the resultsresults = MicroFour.StrataFrame.Data.DataBasics.DataSources[""].GetDataTable(cmd, Nothing);
//-- Now cycle through and populate the comboforeach (DataRow row in results.Rows){ //-- populate the combo with the row...}
Thanks!Bill