>>Sub btn_chgpwd(ByVal s As Object, ByVal e As EventArgs) >> If IsValid Then >> myConnection = New OracleConnection(odh) >> myConnection.Open() >> myTrans = myConnection.BeginTransaction() >> myCommand = myConnection.CreateCommand() >> With myCommand >> .CommandText = "pkg_users.UPDATE_USERS_QUESTION" >> .CommandType = CommandType.StoredProcedure >> .Transaction = myTrans >> Dim P_USER_ID, P_USER_QUESTION, P_ANSWER, P_MODIFIED_BY, P_ERROR_ID, P_ERROR_MSG As OracleParameter >> With .Parameters >> P_USER_ID = .Add("@P_USER_ID", OracleType.VarChar, 10) >> P_USER_ID.Value = Session("UserName") >> >> P_USER_QUESTION = .Add("@P_USER_QUESTION", OracleType.VarChar, 120) >> P_USER_QUESTION.Value = txtnewpassword.Text >> >> P_ANSWER = .Add("@P_ANSWER", OracleType.VarChar, 60) >> P_ANSWER.Value = txtrenewpassword.Text >> >> P_MODIFIED_BY = .Add("@P_MODIFIED_BY", OracleType.VarChar, 10) >> P_MODIFIED_BY.Value = Session("UserName") >> >> P_ERROR_ID = .Add("@P_ERROR_ID", OracleType.Double) >> P_ERROR_ID.Direction = ParameterDirection.Output >> >> P_ERROR_MSG = .Add("@P_ERROR_MSG", OracleType.VarChar, 100) >> P_ERROR_MSG.Direction = ParameterDirection.Output >> End With >> End With >> >> Try >> myCommand.ExecuteNonQuery() >> >> If P_ERROR_ID.Value = 0 Then >> Response.Write("before commit") >> myTrans.Commit() >> myConnection.Close() >> Response.Redirect("/login/menu.aspx") >> Else >> myTrans.Commit() >> myConnection.Close() >> End If >> Catch eex As Exception >> Response.Write(eex.ToString()) >> myTrans.Rollback() >> myConnection.Close() >> End Try >> End If >>End Sub >> >>>>
>>>>Dim strProvider As String = "OracleClient" >>>> >>>>If strProvider = "OracleClient" >>>> Dim ConPubs As New OracleConnection(odh) >>>>Else >>>> Dim ConPubs As New OleDbConnection(odh) >>>>End If >>>> >>>>ConPubs.Open() >>>>>>>>