NET: unknown error 1

NET: unknown error 1

Postby wernervdh8 » Thu 10 Oct 2013 07:15


I'm getting error in subject bar.

Code: Select all
private void btnLogin_Click_1(object sender, EventArgs e)

            OracleCommand cmd = new OracleCommand();
            cmd.Connection = conn;
            cmd.CommandTimeout = 0;
            cmd.CommandText = "hhrcv_logon_validation";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("pv_emp_username", OracleDbType.VarChar).Value = txtUsername.Text;
            cmd.Parameters.Add("pv_emp_password", OracleDbType.VarChar).Value = txtPassword.Text;
            cmd.Parameters.Add(new OracleParameter("pv_return_message", OracleDbType.VarChar));
            cmd.Parameters["pv_return_message"].Direction = ParameterDirection.Output;
            string valid;
            valid = cmd.Parameters["pv_return_message"].Value.ToString();
            if (valid.ToString() == "")
                frmHome main = new frmHome(lblEmp_id_no.Text);
                MessageBox.Show("" + valid, "Error");

Im getting the exception was unhandled error on: cmd.ExecuteNonQuery();

DB side:
Code: Select all
create or replace
PROCEDURE          hhrcv_logon_validation (
                                                pv_emp_username in varchar2,
                                                pv_emp_password in varchar2,
                                                pv_return_message out varchar2) is

  lv_emp_username   dc_emp.emp_username%type;
  e_stop_error      exception;
  cursor c_emp_exists is
    select upper(emp_username)
      from dc_emp
     where emp_username = upper(pv_emp_username);                                   

  cursor c_emp_password_exists is
    select upper(emp_username)                     
      from dc_emp
     where emp_username = upper(pv_emp_username)
       and emp_password = upper(pv_emp_password);                                   
  open c_emp_exists;
    fetch c_emp_exists into lv_emp_username;
    if c_emp_exists%notfound then
      pv_return_message := 'Invalid Employee Username.';
      raise e_stop_error;   
    end if;
  close c_emp_exists;
  open c_emp_password_exists;
    fetch c_emp_password_exists into lv_emp_username;
    if c_emp_password_exists%notfound then
      pv_return_message := 'Invalid Password. Please try again.';
      raise e_stop_error;     
    end if;
  close c_emp_password_exists;
  when e_stop_error then
  when others then
    pv_return_message := 'Others '||sqlerrm;

Please help
Posts: 2
Joined: Thu 15 Nov 2012 13:26

Re: NET: unknown error 1

Postby wernervdh8 » Thu 10 Oct 2013 09:47

Our DBAs implemented password expiry dates on our user accounts. The one we were using for the app was expired. Although I could still use the account to make the connection to DB and actually query data in the DB it didn't want to work from the app.

So issue is solved.
Posts: 2
Joined: Thu 15 Nov 2012 13:26

Return to dotConnect for Oracle