Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 109123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:01:12+00:00 2026-05-11T02:01:12+00:00

in my data layer class I have created a function to manually refresh the

  • 0

in my data layer class I have created a function to manually refresh the data source.

Public Sub DiscardAllChanges()      _Context.Refresh(RefreshMode.OverwriteCurrentValues)  End Sub 

The problem is that the context ChangeSet after this operation still trace the previous operation of Insertion, Deletion and Update that I made calling manually InsertOnSubmit, etc.

Is it possible to clear also the ChangeSet in some way? Or if not can you suggest me another solution? Do I have to create a ChangeSet layer in the Business?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T02:01:12+00:00Added an answer on May 11, 2026 at 2:01 am

    The easiest way to handle this is to treat the DataContext as your unit of work. Perform an atomic set of related operations on a single DataContext, then after either success or failure, Dispose() it (ideally via using) and throw it away.

    Start you next set of operations on a new DataContext. Likewise, you can re-query for data.

    On an object-by-object basis, you can use GetOriginalEntityState (on the table) to get the original values, but you’d need to re-apply to a ‘live’ object, and this doesn’t handle the delete/insert cases.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 64k
  • Answers 64k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer To Debug JavaScript Problems, better post the generated HTML To… May 11, 2026 at 10:42 am
  • added an answer I was looking for something similar myself a while ago… May 11, 2026 at 10:42 am
  • added an answer You can use BitConverter to convert data to and from… May 11, 2026 at 10:42 am

Related Questions

in my data layer class I have created a function to manually refresh the
In .NET if my DB is SQL Server then in datalayer we have statements
I have the following problem in my Data Structures and Problem Solving using Java
Related to this question , I decided to check the UDFs in my data
In my Core Data managed object model, I have an entity Foo with a
The Data in my DataTable is like ID ContactName1 Designation1 ContactName2 Designation2 1 A
I need to render JSON data in my JSPs for some AJAX requests. I'd
I would like to do full-text searching of data in my Ruby on Rails
I'm trying to save some XML-Data in my UserSettings (Properties.Settings.Default.UserSettings) in a .NET Winforms
I would like to store log4net config data in my application.config file. Based on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.