SQLTeam.com | Weblogs | Forums

Lookup value of a datalist

Hello everyone.
I have been pulling my hair out on this one. I can't see what I am doing wrong. Can someone please help.
I have a datalist which I pull value from a table. Then I want to pull values for a gridview that matches the value of the datalist. Appreciate your help!!!

My Datalist:
<asp:DataList ID="ModelCodeLabel" runat="server" DataSourceID="ModelCode"
CssClass="code" Width="250px" DataKeyField="Code">

<asp:Label ID="CodeLabel" runat="server" Text='<%# Eval("Code") %>' />





</asp:DataList>
<asp:SqlDataSource ID="ModelCode" runat="server"
ConnectionString="<%$ ConnectionStrings:TechCenterConnectionString %>"
SelectCommand="SELECT DISTINCT [Code] FROM [tblSidingModels] WHERE (([Series] = @Series) AND ([Model] = @Model))">

<asp:ControlParameter ControlID="ddSeries" Name="Series"
PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="ddModel" Name="Model"
PropertyName="SelectedValue" Type="String" />

</asp:SqlDataSource>

My Gridview:
<asp:GridView ID="GV_Performance" runat="server" Width="100%"
AutoGenerateColumns="False" BackColor="LightGoldenrodYellow" BorderColor="Tan"
BorderWidth="1px" CellPadding="2" DataSourceID="ModelPerformance"
ForeColor="Black" GridLines="None">


<asp:BoundField DataField="Code" HeaderText="Code" SortExpression="Code" />
<asp:BoundField DataField="Description" HeaderText="Description"
SortExpression="Description" />
<asp:BoundField DataField="ReportNo" HeaderText="ReportNo"
SortExpression="ReportNo" />









</asp:GridView>
<asp:SqlDataSource ID="ModelPerformance" runat="server"
ConnectionString="<%$ ConnectionStrings:TechCenterConnectionString %>"
SelectCommand="SELECT DISTINCT [Code], [Description], [ReportNo] FROM [tblSidingTestReport] WHERE ([Code] = @Code)">

<asp:ControlParameter ControlID="ModelCodeLabel" Name="Code"
PropertyName="SelectedValue" Type="String" />

</asp:SqlDataSource>