basic solution without advance

本帖於 2004-02-06 15:24:48 時間, 由普通用戶 old-cotton 編輯

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--
請您先登陸,再發跟帖!