1. if you are using SQL Server, try //在你的SQL语句里添加select identity(int,1,1) as 'id', * into #mytemp from YourTable
select * from #mytemp 2. you could add a column to the DataTable: 在datatable里添加一行DataTable1.Columns.Add("ID",typeof(int));
int i=0; foreach (DataRow dr in DataTable1.Rows) { dr["ID"] = ++i; } 3. or you can use in your template 在模板上添加<%# Container.ItemIndex+1 %> |