I have table1 and table2, tables have same structure (all fields are same). My question is which is the easiest way to add data from table2 into table1?
regard j
Printable View
I have table1 and table2, tables have same structure (all fields are same). My question is which is the easiest way to add data from table2 into table1?
regard j
Not sure what DB you're using, if it's MSSQL, look up SELECT INTO in BOL (books online).
Something like this (I did test the code though)
VB Code:
Private Sub CopyDT() 'DataTable One that we'll copy from Dim DT1 As New DataTable("Tb Name") 'DataTable Two that we'll copy to Dim DT2 As New DataTable("Tb Name") Dim adp As New OleDb.OleDbDataAdapter 'Get data from DataTable One adp.Fill(DT1) 'Update from DataTable One adp.Update(DT2) End Sub