frenchie
frenchie

Reputation: 52047

testing if DB update was successful with linq-to-sql

I'm using linq-to-sql to update an entry in the table. I'm first fetching a record and then I'm doing this:

using (MyDC TheDC = new MyDC())
{
  // fetch record
  // do updates

  TheDC.SubmitChanges();

}

After I submit the changes, I just go on with my code.

How do I know the update really happened?

Thanks.

Upvotes: 0

Views: 596

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039498

How do I know the update really happened?

No exception was thrown.

Other than that you could use the GetChangeSet method to get the modified objects tracked by the data context.

Upvotes: 3

Related Questions