Quotes, tags, and "greater than" signs

Discussion in 'ASP .Net' started by danthman, Dec 23, 2005.

  1. danthman

    danthman Guest

    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
    danthman, Dec 23, 2005
    #1
    1. Advertising

  2. Try using the HTML escaped version.
    > becomes &gt;

    < becomes &lt;

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


    Joshua Flanagan
    http://flimflan.com/blog
    Joshua Flanagan, Dec 23, 2005
    #2
    1. Advertising

  3. danthman

    danthman Guest

    Yes! That was it. Thanks.

    -Dan
    danthman, Dec 23, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. BobRoyAce
    Replies:
    7
    Views:
    457
    Peter Blum
    Mar 3, 2005
  2. Ryan
    Replies:
    1
    Views:
    511
  3. falcon
    Replies:
    10
    Views:
    18,643
    Roedy Green
    Feb 24, 2006
  4. Paddy3118
    Replies:
    6
    Views:
    514
    TreeStages
    Dec 14, 2007
  5. Dwight Army of Champions
    Replies:
    4
    Views:
    2,745
    John H.
    Mar 17, 2010
Loading...

Share This Page