Click here to Skip to main content
15,921,793 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all

Iam using vb.net , and WPF application.

with data base SQL server 2005.

How to write commit Roll back in vb.net code .

Give me some example with queries.

MY VB CODE :
``````````
try
SQL
msSQL = " INSERT INTO m_tproductadd " & _
               " (Product_name,material_gid,standard" & _
               " ) Values ( " & _
               "'" & txtProducts.Text & "'," & _
               "'" & cbomaterialname.SelectedValue & "'," & _
               "'" & txtStandard.Text & "')"


VB
msSQL = " INSERT INTO m_tphysicalparticalsadd " & _
              " (phy_name " & _
              " ) Values ( " & _
              "'" & txtphypartical.Text & "')"
      mnResult = objdbconn.ExecuteNonQuery(msSQL)


catch
end try

IF ANY OF INSERT FAILS ,COMMIT ROLL BACK HOW TO DO

Thanks in advance

Regards

Naveen...
Posted
Updated 30-Mar-10 5:36am
v3

1 solution

 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900