ASP.NET SqlDataSource - DataSourceMode DataSet

SqlDataSource DataSourceMode DataSet
DataSourceModeDataSet.aspx

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

<!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>asp.net SqlDataSource example: DataSourceMode DataSet</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:Teal">DataSourceMode DataSet Example</h2>
        <asp:SqlDataSource
             ID="SqlDataSource1"
             runat="server"
             ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
             DataSourceMode="DataSet"
             SelectCommand="SELECT TOP 25 ProductID, ProductName, UnitPrice FROM Products"
             >
        </asp:SqlDataSource>
        <asp:Label ID="Label1" runat="server" Text="Sorting and Paging are enable <br /> in DataSourceMode DataSet" Font-Bold="true" ForeColor="IndianRed">
        </asp:Label>
        <br /><br />
        <asp:GridView
             ID="GridView1"
             runat="server"
             DataSourceID="SqlDataSource1"
             AllowPaging="true"
             PageSize="5"
             AllowSorting="true"
             BackColor="Snow"
             ForeColor="LightCoral"
             HeaderStyle-BackColor="HotPink"
             HeaderStyle-ForeColor="Snow"
             BorderColor="HotPink"
             >
        </asp:GridView>
    </div>
    </form>
</body>
</html>
More asp.net examples