Calling Oracle stored procedure from C#?

后端 未结 7 2178
说谎
说谎 2020-11-27 06:10

How does one call a stored procedure in oracle from C#?

7条回答
  •  不知归路
    2020-11-27 06:15

    It's basically the same mechanism as for a non query command with:

    • command.CommandText = the name of the stored procedure
    • command.CommandType = CommandType.StoredProcedure
    • As many calls to command.Parameters.Add as the number of parameters the sp requires
    • command.ExecuteNonQuery

    There are plenty of examples out there, the first one returned by Google is this one

    There's also a little trap you might fall into, if your SP is a function, your return value parameter must be first in the parameters collection

提交回复
热议问题