Search code examples
c#datatabledataviewrowfilter

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?


Solution

  • To filter a dataTable-

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

    To Filter datatview-

    dv.RowFilter = "customer_name = ''";