Delete Rows from DataTable Using Linq in C#

Category: C#.NetLINQ Comments: No comments

Delete Rows from DataTable Using Linq in C# :-

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

rows.ToList().ForEach(r => r.Delete());
dt.AcceptChanges();

Leave a Reply

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

*

HTML tags are not allowed.