开发者

The OracleParameterCollection only accepts non-null OracleParameter type objects, not OracleParameter objects

开发者 https://www.devze.com 2023-03-29 07:39 出处:网络
I got the following error : The OracleParameterCollection only accepts non-null OracleParameter type objects, not OracleParameter objects.

I got the following error :

The OracleParameterCollection only accepts non-null OracleParameter type objects, not OracleParameter objects.

the code is something like this:

System.Data.Common.D开发者_如何转开发bCommand dbCommand = Db.GetStoredProcCommand("ARCHIVE.FSP_STACKHOLDERSBYCREDENTIALS");
dbCommand.Parameters.Add(new OracleParameter("P_Password", password));

My oracle DB is : 11gR2 x64 running on windows 7(x64) My project is : .Net 4.0/Visual studio 2010 (build:any cpu) IIS : 7.5 / app pool:default(asp.net4.0/integrated) My ODP.Net comes from : ODAC112021Xcopy_32bit

NOTE : I cannot change my Oracle.DataAccess.dll to x64 version becuase the project depends on some old dlls(it is because of changing to use the Oracle.DataAccess.dll x64 version, needs to chnage the PlatformTarget to x64 too)

so what should I do? thanks in advance


The problem was on my own! I configed Db.GetStoredProcCommand() function improperly. which cause to create System.Data.Oracle.OracleCommand which comes from microsoft provider instead of oracle client provider. But the text of exception was really misleading!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号