Do you want another reference to the same connection object?
Then just create another variable type of OracleConnection and assign it to
an existing one.
Note however they are the same object instance, not a new connection.
If you close, etc., one, you close them both.
If you want another one with the same parameters, then you need to create a
new one. You could copy the appropriate parameters such as connection string
and such from the original. These would then be 2 seperate connections.
Gerald
"Jul" <ju********@sympatico.ca> wrote in message
news:pr********************@news20.bellglobal.com. ..
"David Browne" <davidbaxterbrowne no potted me**@hotmail.com> wrote in
message news:ux**************@tk2msftngp13.phx.gbl...
"Jul" <ju********@sympatico.ca> wrote in message
news:GM********************@news20.bellglobal.com. .. Hi,
I need to create copy (clone) the OracleConnection object.
I doubt that.
Why? The called module is DLL, sure it can open another connection but why
not use the previous one?
Anyway , you already answered that I can not create a copy, thanks.
Maybe you also know the answer to my second question - I posted it with
subject "Declare as Public at different modules"
The OracleConnection class does not contain "Clone" method for
creating copy.
It contains Protected MemberwiseClone
but if use this method:
conDB = CType(conValue.MemberwiseClone(), OracleConnection)
(it is an example from help)
the VS returns error: method is not accessible in this contest because it is 'Protected'
How this method can be used or any another way to copy object?
You can't copy an OracleConnection since it wraps an OCI session. You
can always create another OracleConnection with the same connection string.
David