none
Submit not all changes RRS feed

  • Question

  • Hi2all!

     

    I want to submit not all, but some changes in datacontext. How can I do this?

    For example, I have 1 Delete, 2 Inserts and 5 Updates, and I want to perfom only first and second updates. Is it possible in linq2sql ?

    Wednesday, July 30, 2008 10:17 AM

Answers

  • You should partition your changes such that only the ones that you want to submit are pending with the DataContext.

     

    In other words, create a DataContext, apply the updates that you want to submit, and then call SubmitChanges(). Then dispose the old DataContext and create a new one, and apply the other changes to it.

     

    Hope that helps,

     

    --Samir

     

    Wednesday, July 30, 2008 4:56 PM

All replies

  • You should partition your changes such that only the ones that you want to submit are pending with the DataContext.

     

    In other words, create a DataContext, apply the updates that you want to submit, and then call SubmitChanges(). Then dispose the old DataContext and create a new one, and apply the other changes to it.

     

    Hope that helps,

     

    --Samir

     

    Wednesday, July 30, 2008 4:56 PM
  • Ok, thank you for your reply!

    Thursday, July 31, 2008 2:49 AM