ADO Net Database ASP.Net Tutorial

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

    protected void srcProducts_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
    {
        lblMessage.Text = "Retrieving data from database";
    }



    Cache SqlDataSource


    
    

            id="lblMessage"
        EnableViewState="false"
        Runat="server" />
    
            id="grdProducts"
        DataSourceID="srcProducts"
        Runat="server" />
    
            id="srcProducts"
        EnableCaching="True"
        CacheDuration="3600"
        SelectCommand="SELECT * FROM Products"
        ConnectionString="<%$ ConnectionStrings:Products %>"
        Runat="server" OnSelecting="srcProducts_Selecting" />
    

    


File: Web.config

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