472,347 Members | 1,914 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,347 software developers and data experts.

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)

thanks.

Nov 17 '05 #1
3 4388
SqlTransaction is a class that calls TSql for you.

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

"Junyin.Wu" <ta**********@gmail.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.com...
what is difference between SqlTransaction and T-Sql(begin tran, commit
tran, rollback tran)

thanks.

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

Thanks.

Nov 18 '05 #3
Yup.

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

"Junyin.Wu" <ta**********@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
you mean:
-----
SqlConnection.BeginTransaction();
SqlTransaction.Commit();
SqlTransaction.Rollback();
----
are equal to
---
SqlCommand.CommandText = "Begin Tran" // "Commit Tran" // "Rollback
Tran";
SqlCommand.ExecuteNonQurey();
----
?

Thanks.

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Kristoff Six | last post by:
Hello, I was reading the MySQLmanual and became confused about myISAM and commit/rollback. Can someone explain what I have to do in my queries...
2
by: mahajan.sanjeev | last post by:
I have two SQLConnection objects having the same connection string and two corresponding SQLCommand objects for each connection object. I am using...
2
by: gabriel | last post by:
Greetings, I am adding foreign keys to a database and saving the generated scripts. What I do not understand is that all script begin with...
5
by: Piotr Strycharz | last post by:
Hi, The question is about how to check if the transaction is still active. Let's say, that I am using a 3rd party stored procedure, that cannot...
9
by: John Sidney-Woollett | last post by:
Is it possible to use the dblink and dblink_exec features from inside pl/pgsql functions to mimic the behaviour of nested transactions by calling...
7
by: fyi85 | last post by:
I have 8.1.5 on Windows 2003, when I do from CLP with auto commit off: db2 update table set column=something and then db2 terminate and then db2...
0
by: eric.goforth | last post by:
Hello, I have a subroutine similar to the following: Private Sub RunUpdateTransaction(ByVal UpdateSQL As String, ByVal UpdateConn As...
3
by: sajithamol | last post by:
What is the need of BEGIN TRAN...COMMIT TRAN? Also why you are setting Transaction isolation level to SERIALIZABLE?
15
by: =?Utf-8?B?UGhpbCBKb2huc29u?= | last post by:
Hi, This is being called in a C# loop within an ado.net transaction from C# 1.1 code. It is used to write large file data to a SQL Server...
5
by: keirnus | last post by:
Hello, I am using Datasheet view when displaying my data. The data are displayed in a "x,y" matrix wherein data can be directly edited in the...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.