james james

james james

  • NA
  • 419
  • 30k

C# Winform Get Top 10 repeated MS Access DataBase

Jul 21 2018 9:41 AM
I have a Winform with MS Access database and want to search for the Top 10 repeaters numbers in a column. The code below will return the first 10 rows. I need to check if a number is repeated in the column and count. I have searched everywhere can someone help?
 I have also tried group and sort last code didnt work either. 
 
  1. string queryString = "SELECT SheetID, Part FROM ILC";  
  2.             queryString = "select top 10 Part,Part from ILC";  
  3.             loadDataGrid(queryString);  
 
 
 
I tried editing this but didnt work.
  1. var q = from c in ILCdb  
  2.                    group c by c.Part into g  
  3.                    select new { g.Key, Count = g.Count() };  
  4.   
  5.            var categoryCounts =  
  6.        from p in ILCdb  
  7.        group p by p.Part into g  
  8.        select new { Category = g.Key, ProductCount = g.Count() };  
 

Answers (1)