VB.Net 在数据表(DataTable)中查询


Select方法返回一个DataRow的数组。
MSDN中的例子:

Private Sub GetRowsByFilter()

Dim table As DataTable = DataSet1.Tables("Orders")

' Presuming the DataTable has a column named Date.
Dim expression As String
expression = "Date > '1/1/00'"
Dim foundRows() As DataRow

' Use the Select method to find all rows matching the filter.
foundRows = table.Select(expression)

Dim i As Integer
' Print column 0 of each returned row.
For i = 0 to foundRows.GetUpperBound(0)
Console.WriteLine(foundRows(i)(0))
Next i
End Sub

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM