Monthly Archives: December 2019

Using group by of two columns and count in sql

By | December 19, 2019

Here is explanation of Using group by of two columns and count in sql as below, lets say we have two table Emp and Dep. Select * from [dbo].[tblDep] id name 1 IT 2 HR 3 Finance Select * from [dbo].[tblEmp] Empid name Gender depId 1002 Jatin male 1 1003 Nirmal male 1 1004 Aditi… Read More »

Remove duplicate objects from JSON file in javascript

By | December 12, 2019

So here is how we can remove the duplicate objects from json file using javascript, [ { “Id”: “12345”, “Name”: “Jatin” }, { “Id”: “12346”, “Name”: “Ajay” }, { “Id”: “12345”, “Name”: “Jatin” }, ] Now i need to remove duplicate records [whose id matches] from above json file, 1) we need to parse json… Read More »

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 »