Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Filtering a empty string in DataTable

How do filter a empty String in DataTable?

I need to filter a column (say Customer Name where the name is string.Empty)

I tried this but i cant get into right way..

I need to filter the DataView through DataView.RowFilter.. so how to give filter string for string.Empty..

Any idea on this?

like image 982
Sankarann Avatar asked Jan 21 '26 13:01

Sankarann


2 Answers

To filter a dataTable-

dt.Select("customer_name = ''"); 

To Filter datatview-

dv.RowFilter = "customer_name = ''";
like image 97
Microsoft DN Avatar answered Jan 24 '26 12:01

Microsoft DN


Use Select method:

DataRow[] foundRows = dt.Select("MyColumn = ''");