Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Quotes, tags, and "greater than" signs (http://www.velocityreviews.com/forums/t116088-quotes-tags-and-greater-than-signs.html)

danthman 12-23-2005 12:36 AM

Quotes, tags, and "greater than" signs
 
I'm trying to write a complex multi-line SQL select command on an
ASP.NET 2.0 page, but I'm not sure how to get the "greater than" sign
(>) into the quotes without it thinking it's a tag. Can this be done?

Here's my code (notice where it says SelectCommand= [multi-line
quote]):

-------------------------
<asp:SqlDataSource
ID="EntryDataSource"
ConnectionString="<%$ ConnectionStrings:JIGSAWExp2 %>"
SelectCommand=
"Select Name, Address, Date
WHERE Name=@CustomerName
AND Date >= @MinimumDate"
runat="server">
<SelectParameters>
<asp:SessionParameter
Name="CustomerName"
SessionField="CustomerName"
Type="String" />
<asp:SessionParameter
Name="MinimumDate"
SessionField="MinimumDate"
Type="DateTime" />
</SelectParameters>
</asp:SqlDataSource>
-------------------------

I've tried a few things, like putting the whole quote inside <% %>,
putting each line of the quote inside <% %>, and just ">=" inside <%
%>, but none of that worked.

Should I just give up and set the command in the code-behind or is
there some easy way to do this I'm just missing?

Thanks in advance,

-Dan


Joshua Flanagan 12-23-2005 03:24 AM

Re: Quotes, tags, and "greater than" signs
 
Try using the HTML escaped version.
> becomes &gt;

< becomes &lt;

so, you would write:
AND DATE &gt;= @MinimumDate


Joshua Flanagan
http://flimflan.com/blog

danthman 12-23-2005 08:20 PM

Re: Quotes, tags, and "greater than" signs
 
Yes! That was it. Thanks.

-Dan



All times are GMT. The time now is 06:44 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.