<%@ Page Language="C#" %>

<html>
<head id="Head1" runat="server">
    <title>Exemplo com a propriedade FilterExpression</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ProviderName="System.Data.SqlClient"
            DataSourceMode="DataReader" ConnectionString="<%$ ConnectionStrings:nwind%>"
            SelectCommand="SELECT CustomerID FROM Customers"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ProviderName="System.Data.SqlClient"
            DataSourceMode="DataSet" ConnectionString="<%$ ConnectionStrings:nwind%>" SelectCommand="SELECT CustomerID, CompanyName FROM Customers"
            EnableCaching="true" CacheDuration="20" CacheExpirationPolicy="Sliding" FilterExpression="CustomerID='{0}'">
            <FilterParameters>
                <asp:ControlParameter Name="CustomerID1" ControlID="DropDownList1" PropertyName="SelectedValue" />
            </FilterParameters>
        </asp:SqlDataSource>
        <asp:DropDownList DataSourceID="SqlDataSource1" AutoPostBack="true" DataTextField="CustomerID"
            DataValueField="CustomerID" ID="DropDownList1" runat="server">
        </asp:DropDownList>
        <asp:GridView DataSourceID="SqlDataSource2" ID="GridView1" runat="server">
        </asp:GridView>
    </div>
    </form>
</body>
</html>
