Link to home
Start Free TrialLog in
Avatar of mikha
mikhaFlag for United States of America

asked on

transaction in asp.net, sql server

say if i need to execute an select and update statement, first I select a value from a table and update/insert another row using the value from the first select statement in the same table. Do i need to execute both sql statements inside a transaction from my C# code? or i don't need transcationScope  here because one is a select statement.

using(TransactionScope tran = new TransactionScope()) {
    //select statement
    //insert statement
    tran.Complete();
}
SOLUTION
Avatar of zephyr_hex (Megan)
zephyr_hex (Megan)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial