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 7817317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:11:38+00:00 2026-06-02T06:11:38+00:00

This really is a generic C# question i think, but i thought about it

  • 0

This really is a generic C# question i think, but i thought about it when trying to handle Entity Framework when persisting the data using ObjectContext and specifically SaveChanges()

Now usually i would just follow what the MSDN documentation advises and the appropriate try/catch logic for the required Exceptions. Example is the following for SaveChanges():

http://msdn.microsoft.com/en-us/library/bb336792.aspx

Now im posing this question because reading the above link, there is one Exception listed, called OptimisticConcurrencyException which is fine. Now reading the example they give there is another listed UpdateException. Now I would expect that to be listed within the Exceptions heading.

So going back to the original question, “How to i know all of the exceptions that could be thrown from an Object or their methods”?

Thanks everyone.

  • 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. Editorial Team
    Editorial Team
    2026-06-02T06:11:40+00:00Added an answer on June 2, 2026 at 6:11 am

    Unfortunately I don’t believe you can. However if you look at the inheritance structure of OptimisticConcurrencyException it inherits from:

    System.Object
      System.Exception
        System.SystemException
          System.Data.DataException
            System.Data.UpdateException
              System.Data.OptimisticConcurrencyException
    

    If you catch System.Data.DataException it should catch both without having to do a catch-all.

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

Sidebar

Related Questions

This question refers to affiliate marketing, but really is a generic question about intercepting
quick question really: I have this code: using System; using System.Collections.Generic; using System.Linq; using
I'm not really familiar with creating generic methods, so I thought I'd put this
I am using Django's comment framework which utilizes generic foreign keys. Question: How do
This might be a way too generic question, but what is the general approach
This is a really generic question, to which I haven't found a simple answer.
I know this is probably a really simple question but I'm having a brain
This really has my stumped today. I'm sure its simple, but... Here is my
This really seems like a bug to me, but perhaps some databinding gurus can
This really puzzled for hours, I searched all over the internet, but got no

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.