what is difference between SqlTransaction and T-Sql(begin tran, commit tran, rollback tran)

what is difference between SqlTransaction and T-Sql(begin tran, commit tran, rollback tran)

Post by Junyin.W » Fri, 18 Nov 2005 17:21:56


what is difference between SqlTransaction and T-Sql(begin tran, commit
tran, rollback tran)

thanks.
 
 
 

what is difference between SqlTransaction and T-Sql(begin tran, commit tran, rollback tran)

Post by Miha Marki » Fri, 18 Nov 2005 18:03:01

SqlTransaction is a class that calls TSql for you.

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://www.yqcomputer.com/

 
 
 

what is difference between SqlTransaction and T-Sql(begin tran, commit tran, rollback tran)

Post by Junyin.W » Sat, 19 Nov 2005 12:10:23

you mean:
-----
SqlConnection.BeginTransaction();
SqlTransaction.Commit();
SqlTransaction.Rollback();
----
are equal to
---
SqlCommand.CommandText = "Begin Tran" // "Commit Tran" // "Rollback
Tran";
SqlCommand.ExecuteNonQurey();
----
?

Thanks.
 
 
 

what is difference between SqlTransaction and T-Sql(begin tran, commit tran, rollback tran)

Post by Miha Marki » Sat, 19 Nov 2005 17:56:27

Yup.

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://www.yqcomputer.com/