2.0: GridView associated to DropDownList

R

R.A.M.

Hi,
I have a problem with definition of GridView assoctiated to
DropDownDataList: GridView is not displayed.
Here is the code:

<asp:DropDownList ID="Publishers" runat="server"
DataSourceID="PublishersSQL" DataTextField="Name"
DataValueField="Name" AutoPostBack="True" />
<asp:SqlDataSource ID="PublishersSQL" runat="server"
ConnectionString="<%$ ConnectionStrings:SQLServerConnectionString %>"
SelectCommand="SELECT Name FROM Publishers ORDER BY Name">
</asp:SqlDataSource>
<asp:GridView ID="Books" runat="server"
AllowSorting="True" AutoGenerateColumns="False"
CellPadding="4" DataSourceID="BooksSQL" GridLines="None">
<Columns>
<asp:CommandField ShowSelectButton="True" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="BooksSQL" runat="server"
ConnectionString="<%$ ConnectionStrings:SQLServerConnectionString %>"
SelectCommand="SELECT Books.Title, Books.Author,
Books.ISBN FROM Books INNER JOIN Publications ON Books.ISBN =
Publications.ISBN WHERE (Publications.PublisherName = @Publisher)
ORDER BY Books.Title">
<SelectParameters>
<asp:ControlParameter ControlID="Publishers"
Name="Publisher" PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:SqlDataSource>

Database tables are defined and filled correctly (I have checked).
Please help.
Thank you very much.
/RAM/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top