It is possible to better method of doing this function? Despite the fact that i am doing the particular query within experience workder, there's a little of the slight pause within the application because the totally happening, so wondered if there is a quicker method of carrying this out.

Basically, the queries are checking the dataset for unique is a result of specific posts, to populate a comboBox with individuals products. This allows us not need to hard code any options in to the filters, and when we add products around the server for individuals values, they're added when next time the dataset is up-to-date instantly.

I am simply not confident that the techniques i am using might be completed in a shorter, faster format:

private IEnumerable<string> queryStatus;
private IEnumerable<string> queryPriority;
private IEnumerable<string> queryCompany;
private IEnumerable<string> queryCategory;

private void filterBuilder_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
   {
       Console.WriteLine(DateTime.Now.ToString());
       DataTable demoCriteria = Ds.Tables[1];
       queryStatus = (demoCriteria.AsEnumerable().Select(row => row.Field<string>("ows_Status"))).Distinct();
       queryPriority = (demoCriteria.AsEnumerable().Select(row => row.Field<string>("ows_Priority"))).Distinct();
       queryCompany = (demoCriteria.AsEnumerable().Select(row => row.Field<string>("ows_Company"))).Distinct();
       queryCategory = (demoCriteria.AsEnumerable().Select(row => row.Field<string>("ows_Category"))).Distinct();
   }

private void filterBuilder_RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e)
   {
       foreach (string row in queryStatus)
       {
           if (!viewFilter_Status.Items.Contains(row))
               viewFilter_Status.Items.Add(new ComboBoxItem(row,
                                                           row));
           if (!editStatus.Items.Contains(row))
               editStatus.Items.Add(new ComboBoxItem(row,
                                                     row));
           if (!newStatus.Items.Contains(row))
               newStatus.Items.Add(new ComboBoxItem(row,
                                                    row));
       }
       foreach (string row in queryPriority)
       {
           if (!viewFilter_Priority.Items.Contains(row))
               viewFilter_Priority.Items.Add(new ComboBoxItem(row,
                                                              row));
           if (!editPriority.Items.Contains(row))
               editPriority.Items.Add(new ComboBoxItem(row,
                                                       row));
           if (!newPriority.Items.Contains(row))
               newPriority.Items.Add(new ComboBoxItem(row,
                                                      row));
       }
       foreach (string row in queryCompany)
       {
           if (!viewFilter_Company.Items.Contains(row))
               viewFilter_Company.Items.Add(new ComboBoxItem(row,
                                                             row));
           if (!editCompany.Items.Contains(row))
               editCompany.Items.Add(new ComboBoxItem(row,
                                                      row));
           if (!newCompany.Items.Contains(row))
               newCompany.Items.Add(new ComboBoxItem(row,
                                                     row));
       }
       foreach (string row in queryCategory)
       {
           if (!viewFilter_Product.Items.Contains(row))
               viewFilter_Product.Items.Add(new ComboBoxItem(row,
                                                             row));
           if (!editProduct.Items.Contains(row))
               editProduct.Items.Add(new ComboBoxItem(row,
                                                      row));
           if (!newProduct.Items.Contains(row))
               newProduct.Items.Add(new ComboBoxItem(row,
                                                     row));
           }

       MainFormCallbacks.EnableISTab(true);
   }