ADO Net Database ASP.Net Tutorial

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


    Show QueryStringParameter Master


    
    

            id="grdProducts"
        DataSourceId="srcProducts"
        AutoGenerateColumns="false"
        ShowHeader="false"
        Runat="server">
        
                    DataTextField="Title"
            DataNavigateUrlFields="Id"
            DataNavigateUrlFormatString="ShowQueryStringParameterDetails.aspx?id={0}" />
        

    
            id="srcProducts"
        SelectCommand="SELECT * FROM Products"
        ConnectionString="<%$ ConnectionStrings:Products %>"
        Runat="server" />
    

    


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


    Show QueryStringParameter Details


    
    

            id="dtlProduct"
        DataSourceID="srcProduct"
        Runat="server" />
            id="srcProduct"
        SelectCommand="SELECT * FROM Products
            WHERE Id=@Id"
        ConnectionString="<%$ ConnectionStrings:Products %>"
        Runat="server">
        
                            Name="Id"
                QueryStringField="Id" />
        

    
    

    


File: Web.config

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