Thursday, 8 August 2013

can i use request.querystring as sqlquery's parameter in asp.net?

can i use request.querystring as sqlquery's parameter in asp.net?

in asp.net i want to make a query on request.querystring but it seem's not
work.
1.var search = Convert.ToString(Request.QueryString["search"]);
2.var query= db.product2s.SqlQuery("select * from product2s where tm
='{0}'",search);
in the webpage i set search="F112130601" but the server response no record
reslt. however if i change the code to below line,i can get response.when
i view the webpage there have some record result from the server.
1.var search="F112130601";
2.var query= db.product2s.SqlQuery("select * from product2s where tm
='{0}'",search);
thanks.

No comments:

Post a Comment