this.ltrCellright.Text = this.getltrCellright();
private string getltrCellright()
{
string retext = "";
string sql = "select * from Apt_rec_sum where APT_no='" + APT_no + "'";
SqlDataReader dr = MySqlBase.GetVarsAsDataReader(sql);
while (dr.Read())
{
for (int i = 0; i < 20; i++)
{
retext += "<tr class=\"tr1\">";
for (int j = 0; j <10; j++)
{
if (j == Convert.ToInt16(dr[i+2].ToString()))
{
retext += " <td class=\"td1\" >";
retext+=dr[i+2].ToString();
retext+="</td>";
}
else
{
retext += " <td class=\"td1\"> </td> ";
}
}
retext += "</tr>";
}
}
return retext;
}
转载于:https://www.cnblogs.com/linpengfeixgu/articles/1231668.html