ADO Database ASP.Net

<%@ Page Language="C#" %>
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

    protected void dtlProducts_DataBound(object sender, EventArgs e)
    {
        DropDownList ddlPager = (DropDownList)dtlProducts.BottomPagerRow.Cells[0]. FindControl("ddlPager");        for (int i = 0; i < dtlProducts.PageCount; i++)
        {
            ListItem item = new ListItem( String.Format("Record {0}",i+1), i.ToString());
            if (dtlProducts.PageIndex == i)
                item.Selected = true;
            ddlPager.Items.Add(item);
        }
    }
    protected void btnPage_Click(object sender, EventArgs e)
    {
        DropDownList ddlPager = (DropDownList)dtlProducts.BottomPagerRow.Cells[0]. FindControl("ddlPager");
        dtlProducts.PageIndex = Int32.Parse(ddlPager.SelectedValue);
    }



    Show Pager Template


    
    

                    id="dtlProducts"
            DataSourceID="srcProducts"
            AllowPaging="true"
            OnDataBound="dtlProducts_DataBound"
            Runat="server">
            
                                    id="ddlPager"
                    Runat="server" />
                                    id="btnPage"
                    Text="Select"
                    Runat="server" OnClick="btnPage_Click" />
            

        
    
                    id="srcProducts"
            ConnectionString="<%$ ConnectionStrings:Products %>"
            SelectCommand="SELECT Id,Title,Director,InStocks FROM Products"
            Runat="server" />
    

    


File: Web.config

  
             connectionString="Data Source=.\SQLEXPRESS;
         AttachDbFilename=|DataDirectory|MyDatabase.mdf;Integrated Security=True;User Instance=True" />