---
title: "How can I delete a row from a datatable using C#?"  
description: "How can I delete a row from a datatable using C#?"  
author: "Takeshi Okada"  
published: 2013-10-22  
updated: 2013-10-22  
canonical: https://www.mindstick.com/forum/1706/how-can-i-delete-a-row-from-a-datatable-using-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# How can I delete a row from a datatable using C#?

How can I [delete](https://www.mindstick.com/forum/33620/how-to-delete-record-from-list-in-mvc-using-ajax) a [row](https://www.mindstick.com/forum/1212/this-row-already-belongs-to-this-table) from a [datatable](https://www.mindstick.com/blog/195/datatable-in-ado-dot-net) using C#?

## Replies

### Reply by Royce Roy

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();
```

\

\


---

Original Source: https://www.mindstick.com/forum/1706/how-can-i-delete-a-row-from-a-datatable-using-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
