为DATATABLE添加行
DataRow row;
while (dt.Rows.Count < 10)
{
row = dt.NewRow();
row[0] = null;
row[1] = DBNull.Value;
dt.Rows.Add(row);
}
遍历DATATABLE
for (int i = 0; i < dt.Rows.Count; i++)
{
for (int j = 0; j < dt.Columns.Count; j++)
{
Response.Write(dt.Rows [i][j]);
}
}
查询所有传感器最近时间的信息
select topotest.*
from (select source,MAX(time) as time from topotest group by source)
temp inner join topotest on
temp.source = topotest.source and temp.time = topotest.time

本文详细介绍了如何在DATATABLE中添加指定数量的空行,并展示了遍历DATATABLE的基本方法。同时,还提供了一个查询所有传感器最近时间信息的SQL查询示例。

被折叠的 条评论
为什么被折叠?



