Use "TOP" to select the first 3 lines and then get the last line from the resultset:
TSQL--SELECT * FROM YourTable TOP 3;
C#--
SQLReader reader = ExecuteReader();
int counter = 0;
While(reader.Read())
{
counter ++;
if(counter == 3)
// get the coloum value here: e.g. Console.Writeline(reader["ColumnName"];
}
basic solution without advance
本帖于 2004-02-06 15:24:48 时间, 由普通用户 old-cotton 编辑