Parameterized query in Oracle trouble

前端 未结 6 904
走了就别回头了
走了就别回头了 2020-12-10 02:14

I\'m using Oracle.DataAccess rather than the obsolete System.Data.OracleClient and I seem to be having trouble passing multiple parameters to my up

6条回答
  •  悲哀的现实
    2020-12-10 02:59

    Although I can't see anything wrong with your example, I wonder if you're being hit by the old BindByName problem. By default, ODP.NET binds parameters to the query in the order in which they are added to the collection, rather than based on their name as you'd like. Try setting BindByName to true on your OracleCommand object and see if that fixes the problem.

    I've had this problem so many times that I use my own factory method to create commands which automatically sets this property to true for me.

    Classic useless Oracle documentation here

提交回复
热议问题