Page 1 of 1

Cannot convert type DbCommand to OracleCommand

Posted: Wed 16 Feb 2011 21:34
by bzhou
I have some base classes that rely on DbProviderFactory.

Factory = DbProviderFactories.GetFactory(getDataProviderName());
DbCommand cmd = Factory.CreateCommand();

In subclass, I need to cast them to OracleCommand,
((OracleCommand)cmd).BindByName = true;

then I got compile error: Cannot convert type 'System.Data.Common.DbCommand' to 'Devart.Data.Oracle.OracleCommand'

It works well when I use Oracle's ODP.net driver, any solutions for Devart's driver?

I also notice that BindByName should be ParameterCheck and PassParametersByName. I wonder if Devart has migration guide.

Thanks

Edit: my bad, I only reference to Devart.Data.Oracle.dll, I forgot Devart.Data.dll
But the question about migration guiding document is still there, I just figured out, I cannot use ArrayBindCount in ArrayBinding, I have to use ExecuteArray(ArrayBindCount ) instead.

Posted: Thu 17 Feb 2011 14:08
by StanislavK
Thank you for your suggestion, we will consider documenting behaviour and interface differences between dotConnect for Oracle and ODP.NET. We will post here when any new information is available.