473,326 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Nested DATASOURCES possible???

Is it possible to have nested datasources?

I have a page that I want laid out like this:

rptCategories ==Category 1
rptItems ==Item 1
rptCategories ==Category 2
rptItems ==Item 1
rptCategories ==Category 3
rptItems ==Item 1

so basically rptCategories is bound to a datasource that calls a stored proc
in the database which returns the categories for the current brand

inside of that, I have rptItems which I want to display the items for the
category of the current brand... the brand id is passed in as a query
string, but the category id is passed in from the rptCategories, but I can't
figure out how to specify that... here is my source:

<asp:SqlDataSource ID="dsCategories" runat="server"
ConnectionString="<%$ ConnectionStrings:cstrDataSource %>"
SelectCommand="sp_GetCategoriesByBrandID"
SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:QueryStringParameter Name="BrandID"
QueryStringField="BrandID" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
<asp:Repeater ID="rptCategories" runat="server"
DataSourceID="dsCategories">
<ItemTemplate>
<hr />
<a style="font: Verdana; font-size:14pt; color:#555555;
font-weight:normal">
<%# DataBinder.Eval(Container.DataItem, "Name") %>
</a>
<br />
<br />
<asp:SqlDataSource ID="dsItems" runat="server"
ConnectionString="<%$ ConnectionStrings:cstrDataSource %>"
SelectCommand="sp_GetItemsByBrandIDAndCategoryID"
SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:QueryStringParameter Name="BrandID"
QueryStringField="BrandID" Type="Int32" />
THIS LINE ERRORS===><asp:Parameter Name="CategoryID" Type="Int32"
DefaultValue=<%# DataBinder.Eval(Container.DataItem, "CategoryID") %/>
</SelectParameters>
</asp:SqlDataSource>
<asp:Repeater ID="rptItems" runat="server"
DataSourceID="dsItems">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "Name") %>
</ItemTemplate>
</asp:Repeater>
<br />
</ItemTemplate>
</asp:Repeater>
</asp:Content>

How do I specify that?

Thanks!
Nov 23 '06 #1
0 1002

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: nimmi_srivastav | last post by:
Below you will see an example of a nested conditional expression that this colleague of mine loves. He claims that it is more efficient that a multi-level if-else-if structure. Moreover, our...
0
by: swethasivaram | last post by:
Hi all I am displaying some information from my database using DetailsView which is bound to SqlDataSource1. <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False"...
0
by: Greg | last post by:
Anyone having issues with their object datasources appearing and vanishing from the datasource browser? I create an object for binding as a datasource in my App_Code folder, compile my web...
9
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got...
0
by: Owen Richardson | last post by:
I have a page that displays a news article in a form view feeding off a datasource that just picks up the id from a query string. I want to add functionality for related links - so i created a...
1
by: Magnus | last post by:
I have a set of typed datasets that are tied to a database on a mssql2005 server. They are naturally displayed and available in the DataSources window. Now I want to rename the database, but when I...
19
by: cpnet | last post by:
I'm using VS2005, C#, ASP.NET 2.0. I'm trying to create a report using SQL Reporting Services (to be used in local mode so I don't have to deal with SQL Server). When I create a new report in my...
2
by: Ole V.-M. | last post by:
Greetings, i have a UserControl, that contains a DataList. That DataList contains as items other DataLists. example: DataList A Row 1 Nested DataList 1 Row 1
0
by: Chris | last post by:
I have a formview that contains a "drill down" set of dropdowns. You select a team and it filters the team members drop down to show team members who belong to that team. I am acheiving this by...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.