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
Printable View
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
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.
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
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);
Would also help if you told us what you mean by "this problem" :)
You mean the one that's in the thread title?Quote:
Originally Posted by mendhak
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