# Remove Empty Rows From DataTable

**URL:** <https://forum.uipath.com/t/remove-empty-rows-from-datatable/12526>\
**Category:** Help\
**Tags:** datatable, excel, system, activities\
**Created:** [September 26, 2017, 12:09pm UTC](https://forum.uipath.com/t/remove-empty-rows-from-datatable/12526 "2017-09-26T12:09:21Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![arivu96](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@arivu96](https://forum.uipath.com/u/arivu96)\
**Post date:** [April 6, 2018, 6:54am UTC](https://forum.uipath.com/t/remove-empty-rows-from-datatable/12526/5 "2018-04-06T06:54:21Z")

</div>

Hi @Joshikumarav,

Use this code  
**`DataTableName=DataTableName.Rows.Cast(Of DataRow)().Where(Function(row) Not row.ItemArray.All(Function(field) field Is DBNull.Value Or field.Equals(""))).CopyToDataTable()`**

Refer below link for more information.

> [@DataTable filtering with expressions](https://forum.uipath.com/t/datatable/21692):
>
> Hi All, Use below code to remove empty row from the table. DataTable name-\>DataTableName Use assign activity DataTableName=DataTableName.Rows.Cast(Of DataRow)().Where(Function(row) Not row.ItemArray.All(Function(field) field Is DBNull.Value Or field.Equals(""))).CopyToDataTable() Re-usable Component pass Parameter as datatable you will get the answer. [RemoveEmptyRows.xaml](https://global.discourse-cdn.com/uipath/original/2X/1/18c0883a487d21d4e0c1031cfa692253af6718cf.xaml) (8.5 KB) Remove rows based on particular column is empty. DataTableName.Select("Convert(column3, System.String)\< \>''"…

Regards,  
Arivu

---

_[View the full topic](https://forum.uipath.com/t/remove-empty-rows-from-datatable/12526)._
