Guys is their a way for you to place multiple update statements in one sql statement so that a sqlcommand object can execute it once.
Here is the code:
Code:
Try
sqlString = "Update tblRates SET Cost = 0.99 WHERE Carrier = 'C&W Land' AND TimeType = 'Peak' "
sqlstring2 = "Update tblRates SET Cost = 0.65 WHERE Carrier = 'C&W Land' AND TimeType = 'OffPeak' "
cmdRates = New OleDbCommand(sqlstring, Conn)
Conn.Open()rowsaffected = cmdRates.ExecuteNonQuery
If rowsaffected <> 1 Then
MsgBox("Update Failed", MsgBoxStyle.Critical, "Update")
Else
MsgBox("Update Successful!", MsgBoxStyle.OKOnly, "Update")
End If
Conn.Close()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical Or MsgBoxStyle.OKOnly, "Warning")
End Try
Is their a way to pass the 2 sql strings to cmdrates at the same time.
What i tried is to see if both statements could be in one?
Need help!