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(","));
原文地址:https://www.cnblogs.com/lizhanglong/p/4191442.html