Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Stored Procedure and c#

Stored Procedure and c#

Scheduled Pinned Locked Moved C#
csharpdatabaseoraclehelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kalyanPaladugu
    wrote on last edited by
    #1

    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

    E 1 Reply Last reply
    0
    • K kalyanPaladugu

      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

      E Offline
      E Offline
      Elina Blank
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups