2010年3月19日

用正则判断字符串是否为数字

摘要: System.Text.RegularExpressions.Regex rex =new System.Text.RegularExpressions.Regex(@"^\d+$"); if (rex.IsMatch(intChar)){return Convert.ToInt32(intChar);} 阅读全文

posted @ 2010-03-19 15:45 编程烂指 阅读(166) 评论(0) 推荐(0) 编辑

DataTable的Distinct的简易方法

摘要: 有时我们需要从DataTable中抽取Distinct数据,以前总是以对DataTable进行foreach之类纯手工方式获取。近来发现DataView可以帮我们直接获取Distinct数据,DataTable dataTable;DataView dataView = dataTable.DefaultView;DataTable dataTableDistinct = dataView.ToT... 阅读全文

posted @ 2010-03-19 14:32 编程烂指 阅读(231) 评论(0) 推荐(0) 编辑

导航