I'm using TransactionScope to submit data in Linq to SQL. My question is, if I use multiple SubmitChanges in the same scope, will all scope roll back in case of an error or just the changes made after the last SubmitChanges? For example:
using (TransactionScope trans = new TransactionScope())
{
using (dbDataContext db = new dbDataContext())
{
try
{
//do some insert
db.SubmitChanges();
//do some updates
db.SubmitChanges();
trans.Complete();
}
catch(Exception ex){}
}
}
If update SubmitChanges throws an exception, will the insert SubmitChanges roll back too?