Data Binding ASP.Net Tutorial

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


    Show CommandField


    
    

            id="grdProducts"
        DataSourceID="srcProducts"
        DataKeyNames="Id"
        AutoGenerateColumns="false"
        Runat="server">
        
                    ButtonType="Image"
            ShowEditButton="true"
            EditText="Edit Product"
            UpdateText="Update Product"
            ShowCancelButton="true"
            CancelText="Cancel Edit"
            ShowDeleteButton="true"
            DeleteText="Delete Product"/>
                    DataField="Title"
            HeaderText="Product Title" />
                    DataField="Director"
            HeaderText="Product Director" />
        

    
            id="srcProducts"
        ConnectionString="<%$ ConnectionStrings:Products %>"
        SelectCommand="SELECT Id,Title,Director FROM Products"
        UpdateCommand="UPDATE Products SET Title=@Title, 
                                         Director=@Director
                                         WHERE Id=@Id" 
        DeleteCommand="DELETE Products WHERE Id=@Id"
        Runat="server" />
    

    


File: Web.config

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