TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ram Pradeep
NA
59
10.9k
Issue on use where condion in mvc 4 with entity frameworkk
Nov 10 2015 3:44 AM
Actually i am trying to get the employees information based on the deptno.
My Tables:
1.tblemployee2-->colomns-->Id,name,email,sal,deptid
2.tbldept2-->colomns-->deptid,deptname.
here 2 tables has the relation with foreign key constraint.
now i want to retrieve employee names whose deptid is matching with deptid of tbldept2 table.I am getting error in controller
public class employeeController : Controller
{
//
// GET: /employee/
public ActionResult Index(int id)
{
employeecontext empcontext = new employeecontext();
employee emplist = empcontext.employees.Where(emp => emp.DEPTID == id);
return View(emplist);
}
public ActionResult Details()
{
employeecontext employeecontext = new employeecontext();
List<employee> empnames= employeecontext.employees.ToList();
return View(empnames);
}
}
solve this .....
Reply
Answers (
5
)
Stored Procedure taking longer time in code then in sql
Crystal Report inside Master Page