ADO Net Database ASP.Net Tutorial

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

    public string IPAddress
    {
        get { return Request.UserHostAddress; }
    }



    Show Page Control Parameter


    
    

            id="frmGuestBook"
        DataSourceID="srcGuestBook"
        DefaultMode="Insert"
        runat="server">
        
                    id="lblName"
            Text="Your Name:"
            AssociatedControlID="txtName"
            Runat="server" />
                    id="txtName"
            Text='<%# Bind("Name") %>'
            Runat="server" />
        
                    id="Label1"
            Text="Your Comments:"
            AssociatedControlID="txtComments"
            Runat="server" />
        
                    id="txtComments"
            Text='<%# Bind("Comments") %>'
            TextMode="MultiLine"
            Columns="60"
            Rows="4"
            Runat="server" />
        
                    id="btnSubmit"
            Text="Submit"
            CommandName="Insert"
            Runat="server" />
        

    
    
            id="grdGuestBook"
        DataSourceID="srcGuestBook"
        Runat="server" />
            id="srcGuestBook"
        SelectCommand="SELECT * FROM GuestBook ORDER BY Id DESC"
        InsertCommand="INSERT GuestBook (IPAddress,Name,Comments)
            VALUES (@IPAddress,@Name,
        ConnectionString="<%$ ConnectionStrings:GuestBook %>"
        Runat="server">
        
                            PropertyName="IPAddress" />
        

    
    

    


File: Web.config

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