Category Archives: Linq

how to update datatable using linq

By | December 8, 2019

here we will update datatable some/multiple column values using linq as below, dtEmployeeList.Select(string.Format(“[SysId] = ‘{0}'”, id)) .ToList<DataRow>() .ForEach(dr => { dr[“EmployeeLocation”] = strLocation; dr[“Address”] = strAdress; dr[“Salary”] = strSalary; });  

Get List of Records that do not exist in another list using linq

By | December 4, 2019

Here is how to get list of records that do not exists in another list using linq. Let’s say we have below two list. class LinqTwoListProgram { static void Main(string[] args) { List<Employee> employee1 = new List<Employee>(); employee1.Add(new Employee() { EmpId = 101 }); employee1.Add(new Employee() { EmpId = 201 }); employee1.Add(new Employee() { EmpId… Read More »