タイトル | : Re: DataSetコピー |
記事No | : 5231 |
投稿日 | : 2007/03/29(Thu) 15:01 |
投稿者 | : るしぇ |
同じ方法のはずですが、 CPU 1.6GHz で8秒前後でした。
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim sTime0 As DateTime Dim eTime0 As DateTime Dim objDS1, objDS2 As DataSet
objDS1 = New DataSet objDS1.Tables.Add(MakeDataTable)
objDS2 = New DataSet objDS2.Tables.Add()
sTime0 = Now objDS2.Merge(objDS1) eTime0 = Now MessageBox.Show(eTime0.Subtract(sTime0).TotalSeconds & " 秒かかりました。")
Me.DataGrid1.DataSource = objDS2 End Sub
Private Function MakeDataTable() As DataTable Dim objDT As New DataTable Dim objColItem As DataColumn Dim objDataRow As System.Data.DataRow
' カラムの設定 For col As Integer = 0 To 1000 - 1 objColItem = New DataColumn("カラム" & col.ToString, Type.GetType("System.Single")) objDT.Columns.Add(objColItem) Next
For row As Integer = 0 To 700 - 1 objDataRow = objDT.NewRow()
For col As Integer = 0 To 1000 - 1 objDataRow.Item(col) = row + col Next
objDT.Rows.Add(objDataRow) Next
Return objDT End Function
|