I have a threshold table in access basically if the ecount value greater than the threshold value , then tests fail or if the ecount less than or equal to the threshold value tests past.
I know how to get the row and determine if a tests pass or fail, my problem is what is the best way to enumerate through the list or dictionary to count or keep count of each tag that occur
so I can verify against the threshold table, what should I do. So I already have a list populated in memory with all the codes that occur, the hard part how to process the count in memory so by a tests, then once i have the count I can say find this code in the table below and compare it to the threshold value
table
testName code threshold value ecount status
apple 001 0 2 fail
apple 002 1 1 pass
apple 003 1 0 pass
orange 001 1 0 pass
orange 002 0 1 fail
orange 003 0 1 fail
rice 001 0 0 pass
rice 002 1 1 pass
rice 003 0 0 pass
Loading
David SmithPosted Oct 23, 2010, 12:52 PM
First off where is good tutorial or book on linq, im a beginner in linq, but im coming up to speed on linq
ok: In the list call codesThatOccur also has item call testsname, I wnat to be able group by list.codes and list.testnames
each testNames has there own individual codes that occur.
the linq below only shows the the code, and how many times they occur, how to format the linq to show testname, code, and then the number occurences by testnames
var codeThatOccr = from list in codeList.codesThatOccur
group list by list.codes into g
select new { number = g.Key, Occurance = g.Count() };
David SmithPosted Oct 23, 2010, 12:28 PM
var codeOccr = from list in codeList.EtagsThatOccur
group list by list.code into g
select new { number = g.Key, Occurance = g.Count() };
David SmithPosted Oct 23, 2010, 11:20 AM
what i need help with is the step before getting to the sample table.
so when i have pull all of the codes into into a dictionary or a list how to get the the count of if each tag that occur.
example : a list or dictionary : How to count the occures using linq or anyway to sum each code up before i process my data to database, once i get the count below i can then do the easy part by verifing the count against the threshold value in the table , which produce the status column.
001 count is 2
002 count is 2
003 count is 4
[0] 001
[1] 001
[2] 002
[3] 003
[4] 003
[5] 003
[6] 003
[7] 002
Sam HobbsPosted Oct 23, 2010, 6:20 AM
Also you say "verify against the threshold table" but you show a threshold value column in the sample data. I think that will confuse others that are trynig to help you.