Update Field Value in DataTable using Linq in C#

Category: C#.NetLINQ Comments: No comments

Update Field Value in DataTable using Linq in C#:-

IEnumerable<DataRow> rows = DataTableObject.Rows.Cast<DataRow>().Where(r => r["EmployeeId"].ToString() == “0123 “&& r["Name"].ToString() == “Abdul”);

rows.ToList().ForEach(r => r.SetField(“EmployeWorking”, “Y”));
rows.ToList().ForEach(r => r.SetField(“EmployeeLocation”, “Microsoft”));

Leave a Reply

Your email address will not be published. Required fields are marked *

*

HTML tags are not allowed.