複製 DataTable – Clone / ImportRow |
Private Function CopyDataTable(ByVal SourceDataTable As DataTable) As DataTable Dim DestinationDataTable As DataTable DestinationDataTable = SourceDataTable.Clone For i As Integer = 0 To SourceDataTable.Rows.Count – 1 DestinationDataTable.ImportRow(SourceDataTable.Rows(i)) Next Return DestinationDataTable End Function |