using (TransactionScope ts = new TransactionScope())
{
//call complete on the TransactionScope or not based on return value
if(someFunc())
ts.Complete(); // Commit the transaction
}
if someFunc() reutrns false - the transaction will rollback because you are
exiting the scope without calling ts.Complete();
--
Misbah Arefin
https://mcp.support.microsoft.com/profile/MISBAH.AREFIN
http://dotnethitman.spaces.live.com
http://www.linkedin.com/in/misbaharefin
"Smokey Grindel" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> If I am inside a function that returns a boolean and i have all the
> commands inside it inside a transaction scope and I do something like a
> return false, which causes it to never run the trancastion scope's
> complete method, this does cancel out the transaction right? causeing it
> to rollback? thanks!
>
>