datalist显示行号的三种方法
2008-11-22 12:51
274 查看
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 %>
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 %>
相关文章推荐
- DataList显示行号的三种方法
- datalist显示行号的三种方法
- datalist、repearter、gridview显示行号的三种方法 或者是获取datalist行id
- C# DataGridView显示行号的三种方法
- emacs行号显示的三种方法
- C# DataGridView显示行号的三种方法
- Eclipse显示行号的三种方法
- C# DataGridView显示行号的三种方法
- 自定义 DataList 显示数据行数的方法
- 如何只显示目录名的三种方法
- DataGrid(WinForm)显示行号最简单的方法
- 在这里对"DataGrid(WinForm)显示行号最简单的方法" 纠正一下错误的地方
- 在MFC对话框中显示图片的三种方法(有两种使用OpenCv)
- 彩色显示adb logcat的方法(三种不同效果)
- 库的三种加载方法 显示加载 隐示加载 延迟加载
- js全屏显示显示代码的三种方法
- VC6.0显示行号插件(含使用方法、注册方法,无使用限制)
- jq中三种显示及隐藏方法
- Android的log工具类(显示类名、方法名、行号)
- Android 日志打印工具类 可显示打印所在的方法和行号