62,046
社区成员
发帖
与我相关
我的任务
分享
public string GetNewObjectComments()
{
string sSQL = "SELECT TOP 7 * FROM ObjectComment ORDER BY CreateTime DESC";
SqlConnection cn = GetOpenedConnection();
cmdGetTopObjectComments = new SqlCommand(sSQL, cn);
SqlDataReader reader = cmdGetTopObjectComments.ExecuteReader();
StringBuilder sb = new StringBuilder();
sb.Append("<table id=\"tb1\" bordercolor=\"#CCD6FF\" cellpadding=\"0\" cellspacing=\"0\" class=\"ltable\"");
sb.Append("<tr>");
sb.Append("<td bgcolor=\"#AABBFF\" height=\"18px\">◎最新评论");
sb.Append("</td>");
sb.Append("</tr>");
while (reader.Read())
{
sb.Append("<tr>");
sb.Append("<td align=\"left\"><a href=\"" + reader["ObjectID"].ToString() + "\" style=\"width:150px;\" clsss=\"ellipsis\">" + reader["Content"].ToString() + "</a>");
sb.Append("</td>");
sb.Append("</tr>");
}
sb.Append("</table>");
return sb.ToString();
}