XModPro

Using wildcard with parameter in CommandText

Jen Sharp Jen Sharp asked Nov 28, 2016
Active Dec 2 · Viewed 2076 times
<p>The SELECT statement I have in my CommandText includes a parameter with a value of [[Url:parametername]] and default value of "%" so it will show all records if the querystring isn't present. This all works great actually, save for one exception that I ran across. I can't figure out the syntax to put the wildcard % in the statement along with the parameter name. </p> <p><br> </p> <p>I tried these ways which failed: </p> <p>1. in the CommandText itself:<br>"SELECT %@parametername% ..." </p> <p>2. in the parameter definition:<br>&lt;parameter name="parametername" value='%[[Url:parametername]]%' ... etc </p> <p>3. in referencing the parameter in the ItemTemplate:<br>... value="%[[template_list@parametername]]%" ... etc </p> <p>Any other syntax ideas to accomplish this? I also tried to urlencode the % to a %25 but that doesn't pass nicely either. </p> <p>I know I can limit the number of records by choosing to display or not display using css and javascript, but it would be cleaner and faster to just limit the records in the first place. </p>

2 Answers

Loading answers...