Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > System.InvalidOperationException: ExecuteReader: Connection property has not been initialized

Reply
Thread Tools

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

 
 
Antoni Massó Mola
Guest
Posts: n/a
 
      06-18-2004
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?


 
Reply With Quote
 
 
 
 
Michelle Hlaing
Guest
Posts: n/a
 
      02-24-2005

--------------------
>From: "Antoni Massó Mola" <(E-Mail Removed)>
>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.***

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The ConnectionString property has not been initialized. Laura K ASP .Net 12 05-15-2010 05:22 AM
ExecuteReader: Connection property has not been initialized MattB ASP .Net 3 10-04-2007 08:09 AM
2.0: "The ConnectionString property has not been initialized." RAM ASP .Net 0 10-09-2006 01:58 PM
ExecuteReader: Connection property has not been initialized. CJM ASP .Net 2 08-17-2004 02:51 PM
ASP.net: Error "Exception Details: System.InvalidOperationException: The ConnectionString property has not been initialized." Tony ASP .Net 6 06-15-2004 09:27 AM



Advertisments