Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123 lines
2.9 KiB

  1. using System;
  2. using System.Collections;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Web;
  7. using System.Web.SessionState;
  8. using System.Web.UI;
  9. using System.Web.UI.WebControls;
  10. using System.Web.UI.HtmlControls;
  11. using System.Data.SqlClient;
  12. namespace XReports
  13. {
  14. /// <summary>
  15. /// Summary description for versiontotal1.
  16. /// </summary>
  17. public class versiontotal1 : System.Web.UI.Page
  18. {
  19. protected System.Web.UI.WebControls.Table tblUploads;
  20. private void Page_Load(object sender, System.EventArgs e)
  21. {
  22. SqlConnection cn = new SqlConnection("Persist Security Info=False;Pwd=ocarpts@2;User ID=ocarpts;Initial Catalog=SnapShot;Data Source=TimRagain06");
  23. SqlCommand cm = new SqlCommand();
  24. SqlDataReader dr;
  25. DateTime dDate = DateTime.Now;
  26. int rowCtr=0;
  27. int cellCtr=0;
  28. int cellCnt = 3;
  29. cn.Open();
  30. cm.CommandType = CommandType.StoredProcedure;
  31. cm.CommandTimeout = 240;
  32. cm.CommandText = "spVersionTotal";
  33. cm.Connection = cn;
  34. dr = cm.ExecuteReader();
  35. // dr.Read();
  36. //for(rowCtr=0; rowCtr <= rowCnt; rowCtr++)
  37. do
  38. {
  39. TableRow tRow = new TableRow();
  40. tblUploads.Rows.Add(tRow);
  41. for (cellCtr = 1; cellCtr <= cellCnt; cellCtr++)
  42. {
  43. TableCell tCell = new TableCell();
  44. if(rowCtr == 0)
  45. {
  46. switch(cellCtr)
  47. {
  48. case 1 :
  49. tCell.Text = "Total";
  50. break;
  51. case 2 :
  52. tCell.Text = "OS Name";
  53. break;
  54. case 3 :
  55. tCell.Text = "OS Version";
  56. break;
  57. default:
  58. tCell.Text = "";
  59. break;
  60. }
  61. tCell.Style["font-size"] = "small";
  62. }
  63. else
  64. {
  65. switch(cellCtr)
  66. {
  67. case 1 :
  68. tCell.Text = dr.GetInt32(0).ToString();
  69. break;
  70. case 2 :
  71. tCell.Text = dr.GetString(1);
  72. break;
  73. case 3 :
  74. tCell.Text = dr.GetString(2);
  75. break;
  76. default:
  77. tCell.Text = "0";
  78. break;
  79. }
  80. tCell.Style["background-color"] = "white";
  81. tCell.Style["font-size"] = "small-x";
  82. tCell.Style["color"] = "#6487dc";
  83. tCell.Style["font-weight"] = "Bold";
  84. }
  85. tCell.Style["font-family"] = "Tahoma";
  86. tRow.Cells.Add(tCell);
  87. }
  88. rowCtr++;
  89. }while(dr.Read() == true);
  90. }
  91. #region Web Form Designer generated code
  92. override protected void OnInit(EventArgs e)
  93. {
  94. //
  95. // CODEGEN: This call is required by the ASP.NET Web Form Designer.
  96. //
  97. InitializeComponent();
  98. base.OnInit(e);
  99. }
  100. /// <summary>
  101. /// Required method for Designer support - do not modify
  102. /// the contents of this method with the code editor.
  103. /// </summary>
  104. private void InitializeComponent()
  105. {
  106. this.Load += new System.EventHandler(this.Page_Load);
  107. }
  108. #endregion
  109. }
  110. }