Your application uses the following code to update a database using a strongly typed DataContext:

Customer cust =
new Customer { CustomerID = "CONTO", CompanyName = "Contoso" };
db.Customers.InsertOnSubmit(cust);
db.SubmitChanges();

You must detect whether the update conflicts with changes made to the database since the query was made.

What should you do?

 Posted by Rajkatie on 9/9/2012 | Category: ADO.NET Interview questions | Views: 2861 | Points: 40
Select from following answers:
  1. Call SubmitChanges within a try-catch block. Handle the ChangeConflictException.
  2. Call InsertOnSubmit within a try-catch block. Handle the ChangeConflictException.
  3. After calling InsertOnSubmit, verify that the ChangeConflicts collection is empty.
  4. All Above

Show Correct Answer


Source: MeasureUp.Com | | Alert Moderator 

Comments or Responses

Login to post response