C# parameterized queries for Oracle - serious & dangerous bug!

前端 未结 3 475
傲寒
傲寒 2020-11-29 11:05

This is an absolute howler. I cannot believe my own eyes, and I cannot believe nobody before me would have discovered this if it was a genuine bug in C#, so I\'m putting it

3条回答
  •  半阙折子戏
    2020-11-29 11:22

    This is not a bug but explicitly mentioned in Oracle ODP.Net documentation. In a OracleCommand class the parameters are bound by position as default. If you want to bind by name then set the property cmd.BindByName = true; explicitly.

    Reference to Oracle documentation. http://download.oracle.com/docs/cd/E11882_01/win.112/e12249/OracleCommandClass.htm#i997666

提交回复
热议问题