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

后端 未结 7 1613
粉色の甜心
粉色の甜心 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:48

    I had the same problem with SqlDataSource Update commands after porting ASPX code to Oracle.DataAcees.Client and solved it by changing OracleCommand.BindByName property in SqlDataSource OnUpdating handler like this:

    protected void SqlDataSource_Updating(object sender, SqlDataSourceCommandEventArgs e)
    {
        Oracle.DataAccess.Client.OracleCommand b_OracleCommand = 
                      (Oracle.DataAccess.Client.OracleCommand)e.Command;
        b_OracleCommand.BindByName = true;
    }
    
    0 讨论(0)
提交回复
热议问题