i have a text box with a search button.on the click of button i want to fetched all the values start with any alphabet say 'm' and bind to grid view.i hv used a query
sqlcommand cmd=new sqlcomand("select * from table where pname='"+textbox1.text+"'%",con);
rajeevinime
Member
406 Points
229 Posts
use of like % in sqlcommand
Jul 15, 2010 04:09 AM|LINK
i have a text box with a search button.on the click of button i want to fetched all the values start with any alphabet say 'm' and bind to grid view.i hv used a query
sqlcommand cmd=new sqlcomand("select * from table where pname='"+textbox1.text+"'%",con);
but it shows that invalid term % how to do this
pls help me
regards
rajeev
Rajeev Kumar
Mark As Answer If It Helps You