Home > DeveloperSection > Forums > How can I delete a row from a datatable using C#?
Takeshi Okada
Takeshi Okada

Total Post:89

Points:629
Posted on    October-22-2013 3:47 AM

 C# C# 
Ratings:


 1 Reply(s)
 1166  View(s)
Rate this:

How can I delete a row from a datatable using C#?



Royce Roy
Royce Roy

Total Post:134

Points:938
Posted on    October-22-2013 4:06 AM

Hey Takeshi!
You can use below line of code for resolve your problem.
var dataTableRows = dataTable.Select("Write condition to select the DataTable Row which you want to delete");
    dataTableRows.ForEach((r) => r.Delete(););
    dataTable.AcceptChanges();

Modified On Apr-05-2016 03:37:59 AM

Don't want to miss updates? Please click the below button!

Follow MindStick