& Lt; % @ Page Language = & quot; C # & quot; AutoEventWireup = & quot; true & quot; Debug = & quot; true & quot; % & gt; & lt; % @ Import Namespace = & quot; System. data & quot; % & gt; & lt; script runat = & quot; server & quot; & gt; public int TrapezoidIndex = 1; int LastNumer = 0; protected void Page_Load (object sender, EventArgs e) {// ASPNET20Book. for more information about mdb databases, see ASP. NET 2.0 application development technology: the disc string ConnectionString =@& quot; Provider = Microsoft. jet. OLEDB. 4.0; Data Source = | DataDirectory | \ ASPNET20Book. mdb; Persist Security Info = True & quot; System. data. oleDb. oleDbConnection cn = new System. data. oleDb. oleDbConnection (ConnectionString); cn. open (); string SQL = & quot; select * from [Score] Order BY Shuxue DESC & quot; System. data. oleDb. oleDbCommand cmd = new System. data. oleDb. oleDbCommand (SQL, cn); System. data. oleDb. oleDbDataReader dr = cmd. executeReader (Command Behavior. closeConnection); GridView1.DataSource = dr; GridView1.DataBind (); dr. close (); cmd. dispose (); cn. dispose ();} protected void GridView1_RowCreated (object sender, GridViewRowEventArgs e) {if (e. row. rowType = DataControlRowType. dataRow) {System. data. common. dbDataRecord db = (System. data. common. dbDataRecord) e. row. dataItem; int Shuxue = Int32.Parse (db [& quot; Shuxue & quot;]. toString (); if (e. row. rowInde X = 0) {LastNumer = Shuxue;} if (LastNumer! = Shuxue) {TrapezoidIndex = e. Row. RowIndex + 1 ;}lastnumer = Shuxue ;}& lt;/script & gt; & lt; html xmlns = & quot; http://www.w3.org/1999/xhtml"><pead Id = & quot; Head1 & quot; runat = & quot; server & quot; & gt; & lt; title & gt; examples of simultaneous ranking of GridView & lt; /title & gt; & lt;/head & gt; & lt; body & gt; & lt; form id = & quot; form1 & quot; runat = & quot; server & quot; & gt; & lt; asp: GridView ID = & quot; GridView1 & quot; runat = & quot; server & quot; AutoGenerateColumns = & quot; false & quot; onRowCreated = & quot; GridView1_RowCreated & quot; & gt; & lt; Columns & gt; & lt; asp: TemplateField HeaderText = & quot; Data No. & quot; & gt; & lt; ItemTemplate & gt; & lt; % # Container. dataItemIndex + 1% & gt; & lt;/ItemTemplate & gt; & lt;/asp: TemplateField & gt; & lt; asp: TemplateField HeaderText = & quot; Student name & quot; & gt; & lt; ItemTemplate & gt; & lt; % # Eval (& quot; UserName & quot;) % & gt; & lt;/ItemTemplate & gt; & lt; /asp: TemplateField & gt; & lt; asp: TemplateField HeaderText = & quot; mathematics & quot; & gt; & lt; ItemTemplate & gt; & lt; % # Eval (& quot; Shuxue & quot;) % & gt; & lt;/ItemTemplate & gt; & lt;/asp: TemplateField & gt; & lt; asp: templateField HeaderText = & quot; ranking & quot; & gt; & lt; ItemTemplate & gt; & lt ;%# TrapezoidIndex % & gt; & lt;/ItemTemplate & gt; & lt;/asp: TemplateField & gt; & lt;/Columns & gt; & lt;/asp: GridView & gt; & lt;/form & gt; & lt; /body & gt; & lt;/html & gt;