In-line code in <asp:SqlDataSource SelectCommand tag

Discussion in 'ASP .Net Web Controls' started by Fred Dag, Aug 24, 2005.

  1. Fred Dag

    Fred Dag Guest

    Hello,

    When I use the following code,

    <asp:SqlDataSource ID="CrescendoWebSqlDataSource" runat="server"
    ConnectionString="<%$ ConnectionStrings:Crescendo WebConnectionString1 %>"

    SelectCommand="SELECT [CatalogueItemID], [CatalogueItemTitle],
    [CatalogueItemDescription], [CatalogueItemImage],
    [CatalogueItemMYOBItemNumber] FROM [CatalogueItem] WHERE CatalogueItemTitle
    LIKE '<%=HttpContext.Current.Request.QueryString["Index"]%>'" >

    </asp:SqlDataSource>



    I get the error Server tags cannot contain <% ... %> constructs.


    I have tried to do this in-line by changing the quoting order etc. I have
    also searched the net but have problems finding relevant information.

    I am rather new to ASP.NET and its quite a steep learning curve. Especially
    without a book dedicated to the subject. I am having to learn by doing. Its
    very hard creating a search to find information on "<%" for example wereas
    it would be explained in order in reference book in order. Is there a good
    ASP.NET reference book. I need a reference book. I don't have time for a
    tutorial book. I'm looking at Pro ASP.NET 2.0 in C# 2005 September 2005 how
    was his 1st edition?

    Is it possible to do this inline? If not how do I change the SelectCommand
    from using code behind? The object ID=CrescendoWebSqlDataSource doesn't
    exist in terms of intellisence.



    Thanks in advance.
    Fred Dag, Aug 24, 2005
    #1
    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. Tammy B
    Replies:
    0
    Views:
    744
    Tammy B
    Mar 9, 2006
  2. shruds
    Replies:
    1
    Views:
    779
    John C. Bollinger
    Jan 27, 2006
  3. phil
    Replies:
    2
    Views:
    34,457
  4. John Kotuby
    Replies:
    1
    Views:
    867
    John Kotuby
    Feb 24, 2007
  5. Martin
    Replies:
    1
    Views:
    267
    Martin
    Mar 28, 2007
Loading...

Share This Page