ADO Net Database ASP.Net Tutorial

The ProfileParameter object enables you to represent any of the properties of the Profile object. 
The ProfileParameter includes all the properties of the Parameter class and the following property:
File: Web.config

  
          AttachDbFilename=|DataDirectory|GuestBookDB.mdf;
      Integrated Security=True;User Instance=True" />
  

  
    
      
        
      

    
  


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


    Show ProfileParameter


    
    

            id="frmGuestBook"
        DataSourceID="srcGuestBook"
        DefaultMode="Insert"
        Runat="server">
        
                    id="lblComments"
            Text="Enter Your Comments:"
            Runat="server" />
        
                    id="txtComments"
            Text='<%# Bind("Comments") %>'
            TextMode="MultiLine"
            Columns="50"
            Rows="4"
            Runat="server" />
        
                    id="btnInsert"
            Text="Add Comments"
            CommandName="Insert"
            Runat="server" />
        

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

    
    

    


File: Web.config

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