Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > In-line code in <asp:SqlDataSource SelectCommand tag

Reply
Thread Tools

In-line code in <asp:SqlDataSource SelectCommand tag

 
 
Fred Dag
Guest
Posts: n/a
 
      08-24-2005
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.




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SelectCommand that does not return any key column information Shenc ASP .Net 3 12-21-2012 03:24 PM
Change selectcommand of accessdatasource in code and sorting or paging mlfblom@gmail.com ASP .Net 0 12-02-2006 11:18 AM
spit out SelectCommand G. Whiz ASP .Net 5 03-07-2006 07:50 AM
how do u invoke Tag b's Tag Handler from within Tag a's tag Handler? shruds Java 1 01-27-2006 03:00 AM
Change selectcommand on click in aspx.vb prontoo ASP .Net 0 12-13-2005 03:30 PM



Advertisments