Using BeginTran/Commit Tran for MS SQL in c#
Posted on 2004-08-12
I need to know how to use the BeginTran and Commit Tran in C#.
Here's the basic background on the problem:
I have a webpage where the user can add new record. The record is inserted into a MS SQL DB. the table has a primary key.
What I need is to get the ID (primary key) of the record that was inserted.
I can get the last record that was added using the select Ident_current. So if I tie the Insert Into and the select ident_current into one transaction, I can get an accurate ID of the record.
So, how do I do this in .Net using C#?????
Please be kind and elobrate your comments