Results 1 to 3 of 3

Thread: Problem with Datarow Objects

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Location
    Toronto , Canada
    Posts
    3

    Problem with Datarow Objects

    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.

  2. #2
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    Looks like the .MemberwiseClone method is what you're looking for:
    ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfsystemobjectclassmemberwiseclonetopic.htm

  3. #3
    New Member
    Join Date
    Nov 2005
    Posts
    7

    Re: Problem with Datarow Objects

    i had the same problem and i found this page

    http://www.firelightsoftware.com/CopyPasteDataset.aspx

    sounds logical ... or???

    ... you can only copy seriazible objects to clipboard... so put the rows in a dataset and copy the dataset to clipboard

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width