private void bindfi_diagnosis() { DataSet ds = new DataSet(); StringBuilder htmlTable = new StringBuilder(); ds = objb.getfinal_diagnosis_byopdcode(Session["opd_code"].ToString()); htmlTable.Append("<table style='width:100%' border=1px>"); htmlTable.Append("<tr ><th>Final Diagnosis</th><th>Remark</th></tr>"); if (!object.Equals(ds.Tables[0], null)) { if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { htmlTable.Append("<tr>"); htmlTable.Append("<td align='center'>" + ds.Tables[0].Rows[i]["final_diagnosis"] + "</td>"); htmlTable.Append("<td align='center'>" + ds.Tables[0].Rows[i]["final_remark"] + "</td>"); htmlTable.Append("</tr>"); } htmlTable.Append("</table>"); PlaceHolder6.Controls.Add(new Literal { Text = htmlTable.ToString() }); } else { htmlTable.Append("<tr>"); htmlTable.Append("<td align='center' colspan='4'>There is no Record.</td>"); htmlTable.Append("</tr>"); } } }