Stored Procedure and c#
-
My Stored procedure in oracle is CREATE OR REPLACE PROCEDURE GETSOME(ctest out INTEGER) AS BEGIN select count(*) into ctest from test; END; My Code in C# is OracleConnection con = GetConnection(); con.Open(); OracleCommand cmd = new OracleCommand("GETSOME", con); cmd.CommandType = CommandType.StoredProcedure; OracleParameter op = new OracleParameter("Emp_ID",OracleType.Int32); op.Direction = ParameterDirection.Output; cmd.Parameters.Add(op); cmd.ExecuteScalar(); con.Close(); Its giving me an error wrong number or types of arguments in call to GETSOME. Can somebody please explain me what iam doing wrong
-
My Stored procedure in oracle is CREATE OR REPLACE PROCEDURE GETSOME(ctest out INTEGER) AS BEGIN select count(*) into ctest from test; END; My Code in C# is OracleConnection con = GetConnection(); con.Open(); OracleCommand cmd = new OracleCommand("GETSOME", con); cmd.CommandType = CommandType.StoredProcedure; OracleParameter op = new OracleParameter("Emp_ID",OracleType.Int32); op.Direction = ParameterDirection.Output; cmd.Parameters.Add(op); cmd.ExecuteScalar(); con.Close(); Its giving me an error wrong number or types of arguments in call to GETSOME. Can somebody please explain me what iam doing wrong
Check the number and type of parameters in your Stored procedure, and number and type of parameters you are passing to it from your C# code. Good Luck!
Sincerely, Elina Life is great!!! Enjoy every moment of it! :-O