Hi Men !!
I will tell u how to implement trnasctions using sql server. U can do the same by changing the realavant data types to oracle.
Private
m_Cnn As new SqlClient.SqlConnection // connection variable
Private
m_Cmd As SqlClient.SqlCommand // command object
Private m_Tran As SqlClient.SqlTransaction // transaction object
m_Cnn.ConnectionString = <connection string goes here>
m_Cmd = m_Cnn.CreateCommand
m_Cnn.OpenConnection()
m_Tran = m_Cnn.BeginTransaction
m_Cmd.Transaction = m_Tran
m_Cmd.CommandText = < Sql statement > // 1st set
m_Cmd.ExecuteNonQuery() // 1st set
m_Cmd.CommandText = < Sql statement > // 2nd set
m_Cmd.ExecuteNonQuery() // 2 nd set
m_Tran.Commit()
m_Cnn.Close()
Above is the code for handling transactions. I something goes wrong while excuting the commands, you can catch that and rollback the transaction.
Hope this will help to solve ur problem !!
Enter your message below
Sign in or Join us (it's free).