basic solution without advance

来源: 2004-01-12 13:06:00 [旧帖] [给我悄悄话] 本文已被阅读:

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"];
}




--文学城www.wenxuecity.com--