merging Datasets

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • firebirds98
    New Member
    • Feb 2008
    • 15

    merging Datasets

    I am trying to merge two datasets, one that comes from a guest and then one that comes from a login.

    For example I have a guest that adds a Dell Computer to his shopping cart. The Guest decides to log in, the log in has a Gateway Computer in the shopping cart. I am trying to merge the two datasets so that the person now has the Dell Computer and the Gateway computer in his shopping cart dataset.

    What it is doing right now is overwriting the Gateway Computer with the Dell Computer, instead of taking both the Dell and Gateway. Also if I switch the places of the datasets it will just not take the Guest Shopping Cart dataset at all.

    Code:
     Dim UserCart As ShoppingCart = Session("UserCart")
                    Dim GuestCart As ShoppingCart = Session("Cart")
    
    GuestCart.CartDataSet.Merge(UserCart.CartDataSet, True, MissingSchemaAction.Add)
Working...