Cast Question

G

Guest

Does anyone know how to cast or convert a
Oracle.DataAccess.Client.OracleCommand to
System.Data.OracleClient.OracleCommand?
Basically, I want to use the Cancel functionality available in the
System.Data.OracleClient.OracleCommand, but everything in the program uses
the Oracle.DataAccess.Client.OracleCommand and I do not want to change things
willy nilly since there are quirks between the two. I know that the newer
versions of Oracle.DataAccess.Client.OracleCommand have the Cancel
capability, but again the different versions of the Oracle ODP can cause
issues that won't be found till it is too late.

Thank you,
Susan
 
N

Nicholas Paldino [.NET/C# MVP]

Susan,

You can't do this, since they don't share an inheritance tree (as far as
I know). You will have to copy the values over to the new instances, or
change everything in your program to use the type you want.

Hope this helps.
 
G

Guest

We can't just force Oracle to play nice and at least be backwards compatible?
:)

Thank you. I will try the copy. But if I copy the values of the
OracleCommand that was created, when I cancel the command in the copied
version, will it actually cancel the procedure running on the database?

Thank you,
Susan

Nicholas Paldino said:
Susan,

You can't do this, since they don't share an inheritance tree (as far as
I know). You will have to copy the values over to the new instances, or
change everything in your program to use the type you want.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Susan said:
Does anyone know how to cast or convert a
Oracle.DataAccess.Client.OracleCommand to
System.Data.OracleClient.OracleCommand?
Basically, I want to use the Cancel functionality available in the
System.Data.OracleClient.OracleCommand, but everything in the program uses
the Oracle.DataAccess.Client.OracleCommand and I do not want to change
things
willy nilly since there are quirks between the two. I know that the newer
versions of Oracle.DataAccess.Client.OracleCommand have the Cancel
capability, but again the different versions of the Oracle ODP can cause
issues that won't be found till it is too late.

Thank you,
Susan
 
N

Nicholas Paldino [.NET/C# MVP]

Susan,

I really am not sure, I am only answering from the perspective of what I
know of the class heiarchies (and what C# will allow). I doubt that if you
make a copy of the command and try and cancel it, it will work.

You are probably better off moving to the object model that provides you
with the features you need, and changing your code appropriately.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Susan said:
We can't just force Oracle to play nice and at least be backwards
compatible?
:)

Thank you. I will try the copy. But if I copy the values of the
OracleCommand that was created, when I cancel the command in the copied
version, will it actually cancel the procedure running on the database?

Thank you,
Susan

Nicholas Paldino said:
Susan,

You can't do this, since they don't share an inheritance tree (as far
as
I know). You will have to copy the values over to the new instances, or
change everything in your program to use the type you want.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Susan said:
Does anyone know how to cast or convert a
Oracle.DataAccess.Client.OracleCommand to
System.Data.OracleClient.OracleCommand?
Basically, I want to use the Cancel functionality available in the
System.Data.OracleClient.OracleCommand, but everything in the program
uses
the Oracle.DataAccess.Client.OracleCommand and I do not want to change
things
willy nilly since there are quirks between the two. I know that the
newer
versions of Oracle.DataAccess.Client.OracleCommand have the Cancel
capability, but again the different versions of the Oracle ODP can
cause
issues that won't be found till it is too late.

Thank you,
Susan
 
G

Guest

I've updated to the newest version of the Oracle ODP and the cancel is now
working. I'm just hoping that it doesn't break anything else. Thank you for
your help. :)

Susan

Nicholas Paldino said:
Susan,

I really am not sure, I am only answering from the perspective of what I
know of the class heiarchies (and what C# will allow). I doubt that if you
make a copy of the command and try and cancel it, it will work.

You are probably better off moving to the object model that provides you
with the features you need, and changing your code appropriately.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Susan said:
We can't just force Oracle to play nice and at least be backwards
compatible?
:)

Thank you. I will try the copy. But if I copy the values of the
OracleCommand that was created, when I cancel the command in the copied
version, will it actually cancel the procedure running on the database?

Thank you,
Susan

Nicholas Paldino said:
Susan,

You can't do this, since they don't share an inheritance tree (as far
as
I know). You will have to copy the values over to the new instances, or
change everything in your program to use the type you want.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Does anyone know how to cast or convert a
Oracle.DataAccess.Client.OracleCommand to
System.Data.OracleClient.OracleCommand?
Basically, I want to use the Cancel functionality available in the
System.Data.OracleClient.OracleCommand, but everything in the program
uses
the Oracle.DataAccess.Client.OracleCommand and I do not want to change
things
willy nilly since there are quirks between the two. I know that the
newer
versions of Oracle.DataAccess.Client.OracleCommand have the Cancel
capability, but again the different versions of the Oracle ODP can
cause
issues that won't be found till it is too late.

Thank you,
Susan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top