p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning C# 2005 Databases (http://p2p.wrox.com/forumdisplay.php?f=283)
-   -   Is it possible to copy n-row to another dataset? (http://p2p.wrox.com/showthread.php?t=71442)

vinod_yadav1919 November 12th, 2008 04:45 PM

Is it possible to copy n-row to another dataset?
 
Is it possible to copy n-row to another dataset?

Currently I am using below code published in another forum..
dim srcRow, dstRow as DataRow, dstTab as Datatable
  srcRow=...
  dstRow=dstTab.NewRow()
  For i as integer=0 to dstrow.columns.count-1
    dstRow(i)=srcrow(i)
  Next
  dstTab.Rows.Add(dstRow)

is there any other way that will copy faster than this??

Any input or pointer will be great !!

Cheers :)

vinod

Old Pedant November 12th, 2008 08:53 PM

Well, if the two rows are *THAT* compatible, you probably don't need to copy the fields one by one.

You can probably just do
    dstTab.Rows.Add( srcrow )

Did you try that???


All times are GMT -4. The time now is 05:23 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.