System.InvalidOperationException: ExecuteReader: Connection property has not been initialized

A

Antoni Massó Mola

Hello, I dont understand whats going on with my DB2 connector. I used to
have the code in a class that worked fine. But when I tried to use it in a
webservice I get this error: System.InvalidOperationException:
ExecuteReader: Connection property has not been initialized.

1) I create and open a new OleDbConnection
adoConn adoConn = new adoConn();
adoConn.Run("INTRANET");

2) I execute the query
OleDbDataReader myReader = adoConn.dbSQLSelect("Select * from USERS");

ERROR

Line 47: myReader = myCommand.ExecuteReader();


What might be the problem?
 
M

Michelle Hlaing

--------------------
From: "Antoni Massó Mola" <[email protected]>
Subject: System.InvalidOperationException: ExecuteReader: Connection property has not been initialized
Date: Fri, 18 Jun 2004 12:14:49 +0200

Hello, I dont understand whats going on with my DB2 connector. I used to
have the code in a class that worked fine. But when I tried to use it in a
webservice I get this error: System.InvalidOperationException:
ExecuteReader: Connection property has not been initialized.

1) I create and open a new OleDbConnection
adoConn adoConn = new adoConn();
adoConn.Run("INTRANET");

2) I execute the query
OleDbDataReader myReader = adoConn.dbSQLSelect("Select * from USERS");

ERROR

Line 47: myReader = myCommand.ExecuteReader();


What might be the problem?
hi Antoni,

It might be because the connection property of the command was null when trying to execute the SQL
command. If you are using COM components, try recompiling and registering them as well.

Hope that helps,

Michelle

***Disclaimer: This posting is provided "as is" with no warranties and confers no rights.***
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top