【问题标题】:select query with contain condition in datatable using c#使用c#在数据表中选择包含条件的查询
【发布时间】:2014-11-24 17:00:09
【问题描述】:

我有一个数据表,我需要将 CONTAINS 条件放入其中。现在正在使用以下查询检索数据表行

DataRow[] resultss = dtDocument.Select("DocumentElementText='" + columnValue + "'");

但我需要在此查询中添加条件(如包含)以从数据表中检索值。

以上是我的数据表。此查询dtDocument.Select("DocumentElementText='New Package'"); 将返回数据表中的第一行。我需要的是,我需要从此数据表中检索包含<td>NAME</td> 的行。如何检索行..??

问候 阿尔沙德

【问题讨论】:

    标签: c# sql-server-2008 datatable django-queryset


    【解决方案1】:

    试试这个

    DataRow[] resultss = dt.AsEnumerable().Where(row => row.Field<string>("DocumentElementText").Contains("Enter Your String Here")).Select(row => row).ToArray<DataRow>();
    

    【讨论】:

      猜你喜欢
      • 2023-03-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多