过滤DataTable中的空字符串 [英] Filtering a empty string in DataTable

查看:202
本文介绍了过滤DataTable中的空字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在DataTable中过滤空字符串?

How do filter a empty String in DataTable?

我需要过滤一列(例如名称为string.Empty的Customer Name)

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..

我需要通过DataView.RowFilter ..过滤DataView,因此如何为string.Empty ..

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

对此有任何想法吗?

推荐答案

过滤数据表-

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

过滤datatview-

To Filter datatview-

dv.RowFilter = "customer_name = ''";

这篇关于过滤DataTable中的空字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆