nerdexam
Microsoft

70-516 · Question #100

You use Microsoft .NET Framework 4.0 and the Entity Framework to develop an application. You create an Entity Data Model that has an entity named Customer. You set the optimistic concurrency option…

The correct answer is B. try. EntitySqlException Represents errors that occur when parsing Entity SQL command text. This exception is thrown when syntactic or semantic rules are violated. System.Exception System.SystemException System.Data.DataException System.Data.EntityException…

Manipulating and Validating Data

Question

You use Microsoft .NET Framework 4.0 and the Entity Framework to develop an application. You create an Entity Data Model that has an entity named Customer. You set the optimistic concurrency option for Customer. You load and modify an instance of Customer named loadedCustomer, which is attached to an ObjectContext named context. You need to ensure that if a concurrency conflict occurs during a save, the application will load up-to-date values from the database while preserving local changes. Which code segment should you use?

Options

  • Atry
  • Btry
  • Ctry
  • Dtry

How the community answered

(27 responses)
  • A
    4% (1)
  • B
    81% (22)
  • C
    4% (1)
  • D
    11% (3)

Explanation

EntitySqlException Represents errors that occur when parsing Entity SQL command text. This exception is thrown when syntactic or semantic rules are violated. System.Exception System.SystemException System.Data.DataException System.Data.EntityException System.Data.EntitySqlException OptimisticConcurrencyException The exception that is thrown when an optimistic concurrency violation occurs. System.Exception System.SystemException System.Data.DataException System.Data.UpdateException System.Data.OptimisticConcurrencyException Optimistic Concurrency (ADO.NET)

Topics

#optimistic concurrency#RefreshMode#conflict resolution#ObjectContext

Community Discussion

No community discussion yet for this question.

Full 70-516 Practice