Ejemplo n.º 1
0
    private void BindData1()
    {
        StringBuilder htmlTable1 = new StringBuilder();
        DataSet       ds1;

        ds1 = objb.getinvestigation_byopdcode(Session["opd_code"].ToString());

        htmlTable1.Append("<table style='width:100%'>");


        if (!object.Equals(ds1.Tables[0], null))
        {
            if (ds1.Tables[0].Rows.Count > 0)
            {
                htmlTable1.Append("<tr>");
                for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
                {
                    htmlTable1.Append("<td>" + ds1.Tables[0].Rows[i]["test_name"] + "</td>");
                }
                htmlTable1.Append("</tr>");
                htmlTable1.Append("</table>");
                PlaceHolder2.Controls.Add(new Literal {
                    Text = htmlTable1.ToString()
                });
            }
            else
            {
                htmlTable1.Append("<tr>");
                htmlTable1.Append("<td align='center' colspan='4'>There is no Record.</td>");
                htmlTable1.Append("</tr>");
            }
        }
    }
Ejemplo n.º 2
0
  private void BindData()
  {
      SqlDataAdapter da;
      DataSet        ds        = new DataSet();
      StringBuilder  htmlTable = new StringBuilder();

      ds = obj.getinvestigation_byopdcode(Session["opd_code"].ToString());

      htmlTable.Append("<table style='width:100%' border=1px>");
      htmlTable.Append("<tr ><th>Investigation</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]["test_name"] + "</td>");
                  htmlTable.Append("<td align='center'>" + ds.Tables[0].Rows[i]["description"] + "</td>");

                  htmlTable.Append("</tr>");
              }
              htmlTable.Append("</table>");
              PlaceHolder1.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>");
          }
      }
  }