Click here to Skip to main content
15,899,314 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi to all!

some can tell me that how to use "trim" in my querry

"DELETE FROM sec_users WHERE userid_vc = ('"+(textBoxUserId.Text) + "')"
Posted
Updated 18-Jul-11 19:35pm
v2

hope it helps.

string sqlToRun = "DELETE FROM sec_users WHERE userid_vc = ('"+textBoxUserId.Text.Trim() + "')"
 
Share this answer
 
Comments
kami124 19-Jul-11 1:40am    
thanks, so nice of you
Mohammad A Rahman 19-Jul-11 1:45am    
not a problem :)
Not sure why you have extra parenthesis, but if this query is from a string variable, you might want something like this.

string query = "DELETE FROM sec_users WHERE userid_vc = '" + textBoxUserId.Text.Trim() + "'";
 
Share this answer
 
v2
The SQL query should be Like this:

string sqlToRun = "DELETE FROM sec_users WHERE userid_vc = ('"+textBoxUserId.Text.Trim() + "')"


Then only it will work.
 
Share this answer
 
v3

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