日期:2014-05-18 浏览次数:20416 次
public void prev(string id, string tablename, HyperLink HyperLink1,string url) { string sql = "select top 1 ArticleTitle,Article_ID from "+tablename+" where Article_ID<" + id; string sql = "select top 1 ArticleTitle,Article_ID from "+tablename+" where Article_ID>" + id; DataSet ds = DbHelperSQL.Query(sql); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = DbHelperSQL.Query(sql).Tables[0].Rows[0]; HyperLink1.Text = DBCommon.CheckChar.CutStr(dr["ArticleTitle"].ToString(), 20); HyperLink1.NavigateUrl = url+"?ArticleId=" + dr["Article_ID"].ToString(); ; } else { HyperLink1.Text = "没有上一篇!"; } }