Click here to Skip to main content
15,896,726 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
this is the query..

SQL
"Update" + TableName + "SET" + DelField + "=1Where" + IDField + "='" + ID + "'";


so can any one suggest me?whats wrong in this query..am using this query in .cs page using c# code..thank you
Posted

Put a space between "1" and "Where".
C#
"Update" + TableName + "SET" + DelField + "=1 Where" + IDField + "='" + ID + "'";


or you want to set DelField value by variable then
C#
"Update" + TableName + "SET" + DelField + "="+DelFieldValue+" Where" + IDField + "='" + ID + "'";


I also recommend you to use SQLParameters for these type operations.
 
Share this answer
 
Go through these Links
Click Here
Click here

Thanks
Raj
 
Share this answer
 
Try this

"Update " + TableName + " SET " + DelField + "='"+DelFieldValue+"' Where " + IDField + "='" + ID + "'";
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900