幸运星空

Lucker的程序人生

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

1. if you are using SQL Server, try

select identity(int,1,1) as 'id', * into #mytemp from YourTable
select * from #mytemp

2. you could add a column to the 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 %>

posted on 2008-11-22 20:52  Lucker  阅读(552)  评论(0编辑  收藏  举报