Filtering a empty string in DataTable

Sankarann picture Sankarann · Jul 10, 2013 · Viewed 13.6k times · Source

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?

Answer

Microsoft DN picture Microsoft DN · Jul 10, 2013

To filter a dataTable-

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

To Filter datatview-

dv.RowFilter = "customer_name = ''";