Copying Data from one DataTable to Another
You can use ImportRow method to do this by calling NewRow adds a row to the table using the existing table schema, but with default values for the row, and sets the DataRowState to Added. Calling ImportRow preserves the existing DataRowState along with other values in the row. If the DataRow that is passed as a parameter is in a detached state, it is ignored, and no exception is thrown.
Sample Code
For Each dr As DataRow In sourceTable.Rows
destinationTable.ImportRow(dr)
Next
But if the destination table have the same structure you can use this clone method copies the structure of the DataSet that including all datatable schemas, relations, and constraints.
Sample Code
Dim dsDestination As DataSet
' clone method copies the structure of the DataSet,
' including all datatable schemas, relations, and constraints
dsDestination = ds.Clone()
For Each dr As DataRow In ds.Tables(0).Rows
dsDestination.Tables(0).ImportRow(dr)
Next
vb.net sample code
5 comments:
Great!!
air max 2019
off white clothing
coach outlet sale
goyard
nike air max 2017
air jordans
coach bags
yeezy boost 350
kyrie 4 shoes
air max 97
site here pop over to these guys Learn More Balenciaga Dolabuy this website hop over to this site
l1i34a6f96 x4e05g7j84 s2o89o3m75 b7g97d0w04 r7q94p1f49 t3l02z0a19
fear of god
golden goose
yeezy
supreme hoodie
off white
chrome hearts outlet
bape
kyrie shoes
off white outlet
kyrie 9
Post a Comment