I have two dropdownlists that are databinding to a SQL database - the first is a list of casinos. When one of those is selected, what's supposed to happen is a list of comp codes for that casino is supposed to populate the second dropdownlist. However, nothing ever populates that dropdownlist. I have a database table for the casino names, another for the comp codes and names, and a third that matches up the casinos and comp codes ids. My query looks good, I think, but I figure out where the issue is. Here's the code I'm using. Any help would be great. Thanks!
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:Reservation %>"
SelectCommand="SELECT [CasinoID], [CasinoName], [CasinoAbbr] FROM [Casino]">
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:Reservation %>"
SelectCommand="SELECT CasinoComp.CasinoID, CasinoComp.CompID, CompCode.CompID, CompCode.CompCode, CompCode.CompName FROM (CasinoComp INNER JOIN CompCode ON CompCode.CompID = CasinoComp.CompID) WHERE (CasinoComp.CasinoID = @CasinoID)">
<SelectParameters>
<asp:ControlParameter ControlID="CasinoID" Name="CasinoID"
PropertyName="SelectedValue" />
</SelectParameters>
</asp:SqlDataSource>
<asp:DropDownList ID="CasinoID" runat="server"
DataSourceID="SqlDataSource1" DataTextField="CasinoName" AppendDataBoundItems="True" DataValueField="CasinoID" AutoPostBack="True">
<asp:ListItem Selected="True" Value="-1">Choose Casino</asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="CompCode" runat="server"
DataSourceID="SqlDataSource2" DataTextField="CompName"
DataValueField="CasinoID">
</asp:DropDownList>
</div>
</form>
</body>
</html>