ASP.NET SqlDataSource SelectCommandType as StoredProcedure for select records

SqlDataSource - Stored procedure for selecting records
SqlDataSourceStoredProcedure.aspx

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
    
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>SqlDataSource - using SelectCommandType as StoredProcedure for select records</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:Navy; font-style:italic;">SqlDataSource Example: using SelectCommandType as StoredProcedure</h2>
        <asp:SqlDataSource 
            ID="SqlDataSource1"
            runat="server"
            ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
            SelectCommand="GetProducts"
            SelectCommandType="StoredProcedure"
            >
        </asp:SqlDataSource>
        <asp:GridView 
            ID="GridView1"
            runat="server"
            DataSourceID="SqlDataSource1"
            AutoGenerateColumns="true"
            AllowPaging="true"
            PageSize="10"
            BorderColor="Snow"
            Font-Names="Comic Sans MS"
            Width="650"
            >
            <HeaderStyle 
                BackColor="DarkGoldenrod" 
                BorderColor="PeachPuff" 
                ForeColor="Snow" 
                Height="45"/>
            <RowStyle 
                BackColor="Chocolate" 
                ForeColor="Snow" 
                Font-Italic="true" />
            <PagerStyle 
                Height="45" 
                HorizontalAlign="Right" 
                BackColor="OrangeRed"
                Font-Bold="true"
                Font-Size="X-Large"
                ForeColor="Snow"
                />
            <PagerSettings Mode="Numeric" />
        </asp:GridView>
    </div>
    </form>
</body>
</html>
GetProducts [StoredProcedure]

CREATE PROCEDURE [dbo]. [GetProducts]
AS
SELECT PRODUCTID, PRODUCTNAME, QUANTITYPERUNIT, UNITPRICE FROM PRODUCTS
More asp.net examples