c# – invoke stored procedure in the server side in ASP.net – Education Career Blog

I want to invoke Oracle stored procedure say,”insert_into_pop” in ASp.net ….
How to pass parameters into it and how shall i invoke it in code-behind…??

,

You can do something like this.

using (OracleConnection connection = GetConnection)
{
  OracleCommand command = new OracleCommand("insert_into_pop");
  command.Connection = connection;
  command.CommandType = CommandType.StoredProcedure;
  command.Parameters.AddWithValue("@Param", value);  // 0 or more parameters passed in here
  command.ExecuteNonQuery();
}

But you should not put this in code behind anyway, you should have some kind of service or business layer that encapsulates logic.

Leave a Comment