本文整理汇总了C#中TableCell.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# TableCell.Dispose方法的具体用法?C# TableCell.Dispose怎么用?C# TableCell.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TableCell
的用法示例。
在下文中一共展示了TableCell.Dispose方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnInit
protected override void OnInit(EventArgs e)
{
String connectionString = ConfigurationManager.AppSettings["ConnectionString"];
SqlConnection sqlConnect = new SqlConnection(connectionString);
SqlCommand cmd = new SqlCommand();
SqlDataReader reader;
cmd.Connection = sqlConnect;
cmd.CommandText = "Retrieve_MMRALL";
cmd.CommandType = CommandType.StoredProcedure;
var Tableheader = new System.Web.UI.WebControls.TableRow
{
Cells = {
new TableCell { Text = "MRID" },
new TableCell { Text = "Defect Name" },
new TableCell { Text = "Tester" },
new TableCell { Text = "Date Found" },
new TableCell { Text = "Severity" },
new TableCell { Text = "Status" },
new TableCell { Text = "Steps to recreate" },
new TableCell { Text = "Comments" },
new TableCell { Text = "Assigned Developer" },
new TableCell { Text = "Update" }
}
};
MMR.Rows.Add(Tableheader);
sqlConnect.Open();
cmd.ExecuteNonQuery();
reader = cmd.ExecuteReader();
int i = 1;
try
{
while (reader.Read())
{
Button Update = new Button();
Update.Text = "Update";
Update.ID = i.ToString();
Update.Click += new EventHandler(this.Update_Click);
Update.OnClientClick = buttonID(Update.ID);
var DataCell = new TableCell();
var TableRow = new TableRow
{
Cells = {
new TableCell { Text = reader["MRID"].ToString() },
new TableCell { Text = reader["Defect"].ToString() },
new TableCell { Text = reader["Tester"].ToString() },
new TableCell { Text = reader["DateFound"].ToString() },
new TableCell { Text = reader["Severity"].ToString() },
new TableCell { Text = reader["Condition"].ToString() },
new TableCell { Text = reader["Steps"].ToString() },
new TableCell { Text = reader["Comment"].ToString() },
new TableCell { Text = reader["Developer"].ToString() },
}
};
DataCell.Controls.Add(Update);
TableRow.Cells.Add(DataCell);
//Response.Write(Update.ID);
MMR.Rows.Add(TableRow);
i++;
DataCell.Dispose();
TableRow.Dispose();
}
}
catch (Exception f)
{
Console.Write(f.Message);
}
finally
{
sqlConnect.Close();
}
}