ADO Database ASP.Net

File: UsernameParameter.cs
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace MyControls
{
    public class UsernameParameter : Parameter
    {
        protected override object Evaluate(HttpContext context, Control control)
        {
            if (context != null)
                return context.User.Identity.Name;
            else
                return null;
        }
    }
}
            
File: Default.aspx
<%@ Page Language="C#" %>
<%@ Register TagPrefix="custom" Namespace="MyControls" %>
   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">


    Show Username Parameter


    
            id="frmGuestbook"
        DataSourceID="srcGuestbook"
        DefaultMode="Insert"
        Runat="server">
        
                    ID="lblComment"
            Text="Comment:"
            AssociatedControlID="txtComment"
            Runat="server" />
                    id="txtComment"
            Text='<%# Bind("comment") %>'
            TextMode="MultiLine"
            Columns="50"
            Rows="4"
            Runat="server" />
                    id="btnInsert"
            Text="Add Entry"
            CommandName="Insert"
            Runat="server" />
        

    
            id="grdGuestbook"
        DataSourceID="srcGuestbook"
        CssClass="guestbook"
        Runat="server" />
            id="srcGuestbook"
        TypeName="YourDataSource"
        SelectMethod="Getter"
        Runat="server">