Link to home
Start Free TrialLog in
Avatar of bmanmike39
bmanmike39

asked on

How do you get the count of records in a db with Entity 4

I'm trying to get the count of the total number of  departments in my db.  but I don't know how to do this with entity. below is what I have and I'm stuck.

Code for button click event:
OrgEntities OE = new OrgEntities();
 tbl_Dept d = OE.tbl_Dept.Count()

Lbl_deptCount.text = d.ToString();

Open in new window


Sample of what I'm Trying to do with Entity:

SELECT *  FROM tbl_Dept  WHERE Did = 2

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bmanmike39
bmanmike39

ASKER

Thank You!
Not a problem bmanmike39, glad I could help.