[ASP.NET] DataTable 結果再篩選

  • 3562
  • 0

DataTable 結果再篩選

以下範例為針對DT篩選後, 儲存於new_table 

01 Dim TempRows As DataRow()
02
03 Dim new_table As DataTable = DT.Clone
04 new_table.Clear()
05
06 If Me.ddl_pman.SelectedValue <> "" Then
07     TempRows = DT.Select(" name = 'spark' ")
08 Else
09     TempRows = DT.Select("")
10 End If
11
12 For Each row As DataRow In TempRows
13     new_table.ImportRow(row)
14 Next

 

-----------------------
Share is Power