Joining two tables using LINQ
I have two tables:
I have two tables:
Below is the code:
Ok so this is a follow-up from MVC 5 ASP.NET Entity Framework Collect Form Data through Range Input , My Database Structure Consists of a Survey Having Many Categories, A Category having many Questions, then a Question having many QuestionResults and finally QuestionResults having many CategoryResults, in the HomeController I have the models being bound through the ViewModel, but I now require it to be populated with my entities through the context with Linq, any help will be greatly appreciated.
public List<MAS_EMPLOYEE_TRANSFER> GetEmployeeTransferListForHR(TimecardDataContext TimecardDC) { List<MAS_EMPLOYEE_TRANSFER> objEmployeeTransferList = null; try { objEmployeeTransferList = new List<MAS_EMPLOYEE_TRANSFER>(); objEmployeeTransferList = TimecardDC.MAS_EMPLOYEE_TRANSFER.Where( employee => employee.HR_ADMIN_IND=="Y").ToList(); } finally { } return objEmployeeTransferList; } It shows all list of values where hr admin indicator=yes. But I have to get hr admin=yes and distinct(empid) from the table MAS_EMPLOYEE_TRANSFER. How to get distinct … Read more
I was wondering if there is easy solution to this or I’m stuck with following:
I am coding in Microsoft Visual Studio 12 in ASP.net using c# and a noob at it.
I have 2 DataTable and I want to create a third DataTable that contais the difference between DataTable 1 and DataTable 2.
I’m trying to query Users including each user’s Interests, but only where an Interest meets certain criteria:
I have the following LINQ query:
There are so many different options coming out of microsoft for data access. Which one is the best for scalable apps?