The below code perform sql transaction in VB.NET. We can use this code in C# also by making only some changes.
Try
            con.Open()
            trans = con.BeginTransaction
            com.Transaction = trans
            com.Connection = con
            strSql = "Insert into Departments values('005','ABC')"
            db.Save(strSql, com)
            strSql = "Update Departments set department_name='EF' where department_code='002"
            db.Save(strSql, com)
            trans.Commit()
        Catch ex As Exception
            MsgBox(ex.Message)
            trans.Rollback()
        Finally
            con.Close()
        End Try
I have created this blog to place some of important things on it for my personal use and also to help others. Now a days I am doing job as Software Engineer in a company. I have completed my graduation in Computer Science from University of Sindh, Jamshoro, Pakistan.
Sunday, September 21, 2008
Subscribe to:
Post Comments (Atom)
Docker Tutorial
I have listed all the necessary commands of Docker below. In case if any is missing or if any improvement required, please share in comment...
- 
Dear Readers, I face this problem in a web application build in .aspx. It mainly occurs when you are performing some action with javascrip...
- 
In my case, this error pertains to Oracle Merge query . After 30 minutes of time wastage and a lot of hunting on different forums, I come to...
- 
Introduction In this article I will explain the concepts of Boxing and UnBoxing. C# provides us with Value types and Reference Types. Valu...
 
 
No comments:
Post a Comment