The DataGrid code is very easy to understand, but to declare, this is to refer to the VB version of Confucius Rewrite, just because some friends say C # is not good to write.
I only write a reference for everyone. Here, thank you to Confucius.
Appe_admin.aspx
<%@ Page language= "C #" codebehind= "Appe_admin.aspx.cs" autoeventwireup= "false" inherits= "bzh_home.appe_admin"% >
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en" >
<HTML>
<HEAD>
<title>appe_admin</title>
<meta name= "generator" content= "Microsoft Visual Studio. NET 7.1" >
<meta name= "Code_language" content= "C #" >
<meta name= "vs_defaultClientScript" content= "JavaScript" >
<meta name= "vs_targetschema" content= "http://schemas.microsoft.com/intellisense/ie5" >
</HEAD>
<body ms_positioning= "GridLayout" >
<form id= "Form1" method= "POST" runat= "Server" >
<font face= "Song Body" ></FONT>
<asp:datagrid id= "DATAGRID1" runat= "Server" autogeneratecolumns= "False" showfooter= "True" onitemcommand= " Itemsgrid_command "
Cellpadding= "4" backcolor= "White" borderwidth= "1px" borderstyle= "None" bordercolor= "#CC9966" >
<selecteditemstyle font-bold= "True" forecolor= "#663399" backcolor= "#FFCC66" ></SelectedItemStyle>
<itemstyle forecolor= "#330099" backcolor= "white" ></ItemStyle>
<footerstyle forecolor= "#330099" backcolor= "#FFFFCC" ></FooterStyle>
<Columns>
<asp:templatecolumn headertext= "Employee ID" >
<ItemTemplate>
<asp:label id=label3 runat= "server" text= ' <%# DataBinder.Eval (Container, "DataItem. Number")%> ' >
</asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:linkbutton id= "LinkButton1" runat= "Server" Commandname= "Insert" >Insert</asp:LinkButton>
</FooterTemplate>
<EditItemTemplate>
<asp:textbox id=textbox5 runat= "server" text= ' <%# DataBinder.Eval (Container, "DataItem. Number")%> ' >
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:templatecolumn headertext= "Last Name" >
<ItemTemplate>
<asp:label id=label1 runat= "server" text= ' <%# DataBinder.Eval (Container, "DataItem. User name")%> ' >
</asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:textbox id= "TextBox2" runat= "Server" ></asp:TextBox>
</FooterTemplate>
<EditItemTemplate>
<asp:textbox id= "TextBox1" runat= "Server" ></asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:templatecolumn headertext= "A-Name" >
<ItemTemplate>
<asp:label id=label2 runat= "server" text= ' <%# DataBinder.Eval (Container, "DataItem. Password")%> ' >
</asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:textbox id= "TextBox4" runat= "Server" ></asp:TextBox>
</FooterTemplate>
<EditItemTemplate>
<asp:textbox id= "TextBox3" runat= "Server" ></asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
</Columns>
<pagerstyle horizontalalign= "Center" forecolor= "#330099" backcolor= "#FFFFCC" ></PagerStyle>
</asp:datagrid>
</form>
</body>
</HTML>
Appe_admin.aspx.cs
Using System;
Using System.Collections;
Using System.ComponentModel;
Using System.Data;
Using System.Data.SqlClient;
Using System.Drawing;
Using System.Web;
Using System.Web.SessionState;
Using System.Web.UI;
Using System.Web.UI.WebControls;
Using System.Web.UI.HtmlControls;
Namespace Bzh_home
{
<summary>
Appe_admin's