DataTable Select查询

  1. 如果是Excel中数据,空数据为DBNull.Value 查询:dt.Select("name is null")
  2. 查询长度:dt.Select("len(convert(name,System.String))>10" 如果是字符型,就无需转换了
  3. 查询GUID时: var filter = "ShopId not in ({0})".FormatWith(ShopIds.Select(p => "CONVERT('{0}', 'System.Guid')".FormatWith(p.ToString("n"))).StringJoin(","));

posted on 2014-12-29 12:51  木龙哥  阅读(449)  评论(0编辑  收藏  举报

导航