DataTable.Select过滤器

时间:2010-12-28 20:42:17

标签: sql vb.net

我需要使用DataTable.Select方法在一列上过滤多个值。

Dim totalFatal As Integer = _
     m_DataSet.Tables("tblAccidentNonMotorist").Select(String.Format( _
     "[AccidentNumber] = '{0}' AND _
     CONTAINS([InjuryClass], '"01" OR "02" OR "03"'", accidentNumber)).Length

我可以使用CONTAINS进行过滤吗?

1 个答案:

答案 0 :(得分:5)

我想你想要 "[AccidentNumber] = '{0}' AND [InjuryClass] in( '01' , '02' , '03')"