Page 1 of 1

Connection property has not been initialized error

Posted: Thu 08 Jun 2006 09:39
by scott.pedersen
Hi,

I am getting the error 'Connection property has not been initialized' when I create and try an execute an OracleCommand object.

I have created the OracleConnection and tested it and it connects to Oracle. What am I missing that is causing this error to occur?

Cheers,

Scott.

Posted: Thu 08 Jun 2006 11:01
by Alexey
Set

Code: Select all

oracleCommand1.Connection=oracleConnection1

Posted: Thu 08 Jun 2006 19:44
by scott.pedersen
Hi Alexey,

Shouldn't there be an automatic relationship between the connection and the command object?

Why does this need to be set manually?

Cheers,

Scott.

Posted: Fri 09 Jun 2006 06:14
by Alexey
There should be no automatic relationship between the connection and the command object, because any form may have more than one OracleConnection component.