<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PublisherBooks.aspx.cs" Inherits="PublisherBooks" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
   <title>Using QueryString Parameters with Data Source Controls</title>
   <link href="chapterStyles.css" type="text/css" rel="stylesheet" />
</head>
<body>
   <form id="form1" runat="server">
      <div id="container">
         <h1>Using QueryString Parameters with Data Source Controls</h1>
         <p>
         This example illustrates how to use querystring parameters with a data source control 
         </p>
		  
         <h2>Books by the selected publisher</h2>
         <asp:GridView ID="grdBooks" runat="server" 
           DataSourceID="dsBooks" CellPadding="5"/>       
                       
         <asp:SqlDataSource ID="dsBooks" runat="server"
             ProviderName="System.Data.OleDb"
             ConnectionString="<%$ ConnectionStrings:Books %>"
              SelectCommand="Select ISBN, Title From Books Where PublisherId=@Pub" >
            <SelectParameters>
      
               <asp:QueryStringParameter QueryStringField="pubid"
                  Name="Pub" DefaultValue="1"/>
            </SelectParameters>
         </asp:SqlDataSource>
      </div>
   </form>
</body>
</html>

