Is there a way to force OracleCommand.BindByName to be true by default for ODP.NET?

后端 未结 7 1627
粉色の甜心
粉色の甜心 2020-12-19 06:25

Since the System.Data.OracleClient library has been deprecated, we are in the process of migrating our code base to use Oracle Data Provider for .NET (ODP.NET) instead. One

7条回答
  •  无人及你
    2020-12-19 06:29

    To reduce # lines of code

    VB.NET

    Dim command As OracleCommand = New OracleCommand(query, connection) With {.CommandType = CommandType.StoredProcedure, .BindByName = True}
    

    C#

    OracleCommand command = new OracleCommand(query, connection) { CommandType = CommandType.StoredProcedure, BindByName = true };
    

提交回复
热议问题