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--