|
-
Jan 22nd, 2007, 10:22 AM
#1
Thread Starter
Hyperactive Member
ExecuteReader: CommandText property has not been initialized
I'm facing this problem while saving some records plz help me I dont know y this occurs and what should i do to avoid this.
I'm using c# 2005 and sql server 2005
Thanx in advance
-
Jan 22nd, 2007, 10:47 AM
#2
Re: ExecuteReader: CommandText property has not been initialized
Well, I don't see how you could be using a reader to save data, but beyond that, I think we'll need to see some code in order to figure it out.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Jan 22nd, 2007, 10:55 AM
#3
Re: ExecuteReader: CommandText property has not been initialized
Once again, I feel compelled to point out that contrary to popular belief, we are not mind readers here. I don't know how this rumor got started, but it's time it ended.
Perhaps if you show us the code in question we might be able to help. Odds are you haven't set the InsertCommand text to the appropriate SQL. But like I said, we're not mind readers.
-tg
-
Jan 22nd, 2007, 11:06 AM
#4
Thread Starter
Hyperactive Member
Re: ExecuteReader: CommandText property has not been initialized
m so sorry for not writing code
m jus usin as
VB Code:
DbAdapter.SelectCommand.CommandText = strSQL;
SqlCommandBuilder DbCommandBuilder = new SqlCommandBuilder(DbAdapter);
DbCommandBuilder.ConflictOption = ConflictOption.OverwriteChanges;
return DbAdapter.Update(dSet, tblName);
-
Jan 22nd, 2007, 11:50 AM
#5
Re: ExecuteReader: CommandText property has not been initialized
Would also help if you told us what you mean by "this problem"
-
Jan 22nd, 2007, 08:44 PM
#6
Re: ExecuteReader: CommandText property has not been initialized
 Originally Posted by mendhak
Would also help if you told us what you mean by "this problem" 
You mean the one that's in the thread title?
As I stated, you're not setting the InsertCommand statement, so it doesn't know how to insert new records.
You're instantiating the CommandBuilder, but then never actually use it either.
-tg
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|