N
Namshub
I've have 3 stored procedures, the trouble is 1 will always execute but the
other two depending opon the clients selection may not but i need to wrap up
into a transaction all 3 procedures. When i excute the SP it return an
error that i must implement IConvertible.
Dim objConn As New SqlConnection(Application("Connectionstring"))
Dim objSQLTrans As SqlTransaction
Dim objCmdReferral As SqlCommand
Dim objCmdTreatments As SqlCommand <----- This is done further down and is
fired twice with different parameters
objConn.Open()
objCmdReferral = objConn.CreateCommand
objCmdTreatments = objConn.CreateCommand
objSQLTrans = objConn.BeginTransaction("Update3Tables")
objCmdReferral.Transaction = objSQLTrans
objCmdTreatments.Transaction = objSQLTrans
With objCmdReferral
.CommandText = "spDBT_InsReferral"
.CommandType = CommandType.StoredProcedure
.Parameters.Add("@ABC", SqlDbType.VarChar, 7)
.Parameters.Add("@DFG", SqlDbType.VarChar, 10)
.Parameters.Add("@EFG", SqlDbType.VarChar, 35)
.....values are added later down in code -------
objCmdReferral.ExecuteNonQuery() <---- it will crash here
--- excute more sps
Cheers
other two depending opon the clients selection may not but i need to wrap up
into a transaction all 3 procedures. When i excute the SP it return an
error that i must implement IConvertible.
Dim objConn As New SqlConnection(Application("Connectionstring"))
Dim objSQLTrans As SqlTransaction
Dim objCmdReferral As SqlCommand
Dim objCmdTreatments As SqlCommand <----- This is done further down and is
fired twice with different parameters
objConn.Open()
objCmdReferral = objConn.CreateCommand
objCmdTreatments = objConn.CreateCommand
objSQLTrans = objConn.BeginTransaction("Update3Tables")
objCmdReferral.Transaction = objSQLTrans
objCmdTreatments.Transaction = objSQLTrans
With objCmdReferral
.CommandText = "spDBT_InsReferral"
.CommandType = CommandType.StoredProcedure
.Parameters.Add("@ABC", SqlDbType.VarChar, 7)
.Parameters.Add("@DFG", SqlDbType.VarChar, 10)
.Parameters.Add("@EFG", SqlDbType.VarChar, 35)
.....values are added later down in code -------
objCmdReferral.ExecuteNonQuery() <---- it will crash here
--- excute more sps
Cheers