求解释下列数据每一行的意思

/// <summary>
 2         /// 分页获取数据列表
 3         /// </summary>
 4         public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int count)
 5         {
 6             //select * from BirdDetectRecord order by 
 7             // DetectTime 
 8             //limit 
 9             //10 
10             //offset 
11             //1
12             StringBuilder strSql = new StringBuilder();
13             strSql.Append("SELECT * FROM BirdDetectRecord order by "); 
14             if (!string.IsNullOrEmpty(orderby.Trim()))
15             {
16                 strSql.Append(orderby);
17             } 
18             strSql.Append(string.Format(" limit {0} offset {1} ",count,startIndex));
19             if (!string.IsNullOrEmpty(strWhere.Trim()))
20             {
21                 strSql.Append(" WHERE " + strWhere);
22             } 
23             return DbHelperSQLite.Query(strSql.ToString());
24         }

函数体开头注释已经给了一个样本SQL查询语句呀。整个函数就是用StringBuilder 把参数拼接成一条SQL语句,然后用DbHelperSQLite执行,返回查询结果DataSet呀。

不过有一个小bug。第13行不应该包括order by,而应该放到16行。如下:

13             strSql.Append("SELECT * FROM BirdDetectRecord "); 
14             if (!string.IsNullOrEmpty(orderby.Trim()))
15             {
16                 strSql.Append("order by ").Append(orderby);
17             }