Click here to Skip to main content
12,244,802 members (57,918 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET C#4.0
this is the query..

"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 16-Nov-12 18:28pm
ythisbug2.1K
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

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

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

I also recommend you to use SQLParameters for these type operations.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Go through these Links
Click Here
Click here

Thanks
Raj
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

Try this

"Update " + TableName + " SET " + DelField + "='"+DelFieldValue+"' Where " + IDField + "='" + ID + "'";
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160426.1 | Last Updated 17 Nov 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100