Data Binding ASP.Net Tutorial

The most important three properties of the BoundField  class are 
the DataField, DataFormatString, and HeaderText properties. 
<%@ Page Language="C#" %>
   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">


    Show BoundField


    
    

            id="grdProducts"
        DataSourceID="srcProducts"
        AutoGenerateColumns="false"
        Runat="server">
        
                    DataField="Title"
            HeaderText="Product Title" />
                    DataField="Director"
            HeaderText="Product Director" />
                    DataField="Totals"
            DataFormatString="{0:c}"
            HtmlEncode="false"
            HeaderText="Box Office Totals" />
        

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

    


File: Web.config

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