ExecuteReader Error Msg - preCharge Forums
It shows that you are unregistered. Please register with us by clicking Here
preCharge Forums


Nav Green LeftNav Right
preCharge Forums > Website Design & Development > Programming > .NET » ExecuteReader Error Msg


Reply
Tcat Right
 
LinkBack Thread Tools Display Modes Tcat Right
Old 07-06-2006   #1 (permalink)
Tom Tom
Junior Member
 
Join Date: Jul 2006
Age: 48
Posts: 25
Default ExecuteReader Error Msg

I keep getting 'ExecuteReader: CommandText property has not been initialized' error message. Why!!!
Tom Tom is offline   Reply With Quote


Old 07-07-2006   #2 (permalink)
AddCoderPro
Junior Member
 
Join Date: Jul 2006
Age: 28
Posts: 15
Default

As far as I know, the Page_Load event fires BEFORE any control event, so the
SQL string has not been initialized when Page_Load calls the data binding method or procedure.

Whether or not that clue solves the problem, you might want to pass a
SqlCommand/OleDbCommand object to the SqlDataAdapter/OleDbDataAdapter instead of passing a query string.
Before passing the SqlCommand/OleDbCommand object, set both its CommandText and CommandType (i.e., "Text") properties.
AddCoderPro is offline   Reply With Quote

Old 07-08-2006   #3 (permalink)
agaba175
Banned User
 
Join Date: Jul 2006
Location: India
Age: 30
Posts: 105
Default Command Text Error Message

Hi,

You are getting this message because you havn't set your command text property for the command object. This property is used to set the SQL query for the command object. Which in turn gives you the result. For setting the command text property use this sample code.

CmdObject.CommandText="SQL Query"
agaba175 is offline   Reply With Quote

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
What HTTP error is generated when there is an error in an ASP page? agaba175 ASP 0 08-05-2006 08:25 PM


footer left
All times are GMT. The time now is 06:54 PM.

DISCLAIMER: preCharge Risk Management is not responsible for any opinions, advice or comments expressed on the preCharge Community Forums.
preCharge® is a registered trademark of preCharge Risk Management | chargeback protection | Merchant Account Blog

Powered by vBulletin
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC6

Electricity Suppliers | Remortgages | Property for sale in Spain | Jogos | Loan

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49