Dibyajyoti Palata

Dibyajyoti Palata

  • 1.5k
  • 275
  • 14.3k

How to get employee details using stored procedure in oracle database

Jul 15 2020 9:46 AM
Help me, anyone, I am new in Oracle access in c# asp.net.
  1. using (OracleConnection objConn = new OracleConnection(strConnection)  
  2. {  
  3. OracleCommand command = new OracleCommand();  
  4. command.Connection = objConn;  
  5. command.CommandText = "SP_GET_EMPLOYEE_DETAIL";  
  6. command.CommandType = CommandType.StoredProcedure;  
  7. command.Parameters.Add("VARCALLDATE", OracleDbType.Varchar2).Value = strdate;  
  8. command.Parameters.Add("VARUCID1", OracleDbType.Varchar2).Value = CODE1;  
  9. command.Parameters.Add("VARUCID2", OracleDbType.Varchar2).Value = CODE2;  
  10. command.Parameters.Add("VARUCID3", OracleDbType.Varchar2).Value = CODE3;  
  11. command.Parameters.Add("VARUCID4", OracleDbType.Varchar2).Value = CODE4;  
  12. command.Parameters.Add("VARUCID5", OracleDbType.Varchar2).Value = CODE5;  
  13. try  
  14. {  
  15. objConn.Open();  
  16. command.ExecuteNonQuery();  
  17. adapter = new OracleDataAdapter(command);  
  18. adapter.Fill(ds);  
  19. objConn.Close();  
  20. Gridlist.DataSource = ds.Tables[0];  
  21. Gridlist.DataBind();  
  22. }  
  23. catch (Exception ex)  
  24. {  
  25. System.Console.WriteLine("Exception: {0}", ex.ToString());  
  26. }  
  27. objConn.Close();  
  28. }
ERROR:

{"ORA-06550: line 1, column 7:\nPLS-00306: wrong number or types of arguments in call to 'SP_GET_EMPLOYEE_DETAIL'\nORA-06550: line 1, column 7:\nPL/SQL: Statement ignored"} 

Answers (3)