bmanmike39
asked on
How would i write the the following query in entity to count the number of rows in a table?
SELECT COUNT(*) AS CNT
FROM web_board
WHERE class_number = 45
MY entity code:
FROM web_board
WHERE class_number = 45
MY entity code:
NLAMEMEntities2 oe = new NLAMEMEntities2();
var cnt = oe.web_board.Where(x =>) x.class_number == "45").Count();
label1.text = cnt.ToString();
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Got it. Thanks for the help! I fat fingers some things. The following worked.
var cnt = oe.web_board.Where(x => x.class_number == "45").Count();
ASKER
Thanks again!
ASKER
The error says i can't use == operator with in and string