DataTable dt = new DataTable(); dt.Columns.Add("name", Type.GetType("System.String")); dt.Columns.Add("date", Type.GetType("System.String")); dt.Columns.Add("type", Type.GetType("System.String")); for (int i = 0; i < PiciList.Count; i++) { if (PiciList[i].Length == 3) { DataRow dr = dt.NewRow(); dr["name"] = PiciList[i][0]; dr["date"] = PiciList[i][1]; dr["type"] = PiciList[i][2]; dt.Rows.Add(dr); } } if (dt != null && dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { sb.Append(""); sb.Append(" " + dt.Rows[i]["name"] + ""); sb.Append(" " + dt.Rows[i]["date"] + ""); sb.Append(" " + dt.Rows[i]["type"] + ""); sb.Append(" " + GetBindStatus(dt.Rows[i]["name"].ToString(), dt.Rows[i]["date"].ToString(), dt.Rows[i]["type"].ToString()) + ""); } strHtml += sb.ToString(); }