Duncanm
Oct 10th, 2002, 12:46 PM
I know this is probably a very easy solution , but I can't find anything anywhere. Basically what I am trying to do is make a copy of a datarow , and delete the current one (for a kind of cut/paste routine). This is my current code :
'create new dataview
Dim dvTemp As New DataView(dsReports.Tables(0))
'create filtered view
dvTemp.RowFilter = "Rowid = " & CStr(RowID)
'get first item in view (filter willl only return 1 item) and copy to clipboard datarow
drRowClipBoard = dvTemp.Item(0).Row
dvTemp.Item(0).Row.Delete()
what is happening is when I call the delete() procedure on the datarow , it will delete the datarow that im storing in the drRowClipBoard object as well , I'm assuming because it is just a reference to the other row and not a copy , how do I make a copy?
Hopefully this makes some sense.
'create new dataview
Dim dvTemp As New DataView(dsReports.Tables(0))
'create filtered view
dvTemp.RowFilter = "Rowid = " & CStr(RowID)
'get first item in view (filter willl only return 1 item) and copy to clipboard datarow
drRowClipBoard = dvTemp.Item(0).Row
dvTemp.Item(0).Row.Delete()
what is happening is when I call the delete() procedure on the datarow , it will delete the datarow that im storing in the drRowClipBoard object as well , I'm assuming because it is just a reference to the other row and not a copy , how do I make a copy?
Hopefully this makes some sense.