|
| syntax error with parameter |
 |
Mon, 3 Mar 2008 18:28:17 +0000 |
I used the following SQL syntax :
SqlDataSource1.SelectCommand = "select * from NamesTable where firstname
like '%'+?nameparam+'%'";
and it gave me this error:
You have an error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use near '+'Alero'+'%'' at line 1
(Alero is the value I pass to the param)
Any help?
Thanks
PS:
the query works fine in SQLServer using '@' instead of MySql's '?' :
SqlDataSource1.SelectCommand = "select * from NamesTable where firstname
like '%'+@nameparam+'%'";
--------------------------------------------------------------------------------
-------------
Solved it using Concat().
|
| Post Reply
|
| Re: syntax error with parameter |
 |
Wed, 5 Mar 2008 10:16:05 +0000 |
Try following code and let me know
SqlDataSource1.SelectCommand = "select * from NamesTable where firstname
like '%" + ?nameparam + "%'"
|
| Post Reply
|
|
|
|
|
|
|
|
|
|