SHOWcode
2018年9月18日 星期二
劃TABLE C#
#region 劃TABLE
Table newTable = Table1;
//準備資料列及資料儲存格
System.Web.UI.WebControls.TableRow testTableRow;
System.Web.UI.WebControls.TableCell testTableCell;
//newTable.ID = "newTable_1";// + tbcount.ToString();
newTable.Attributes["runat"] = "server"; //
//2列
for (int TR_i = 0; TR_i < str_date_rpt.Rows.Count + 2; TR_i++)
{
testTableRow = new TableRow();
//2格 >按照站別動態給格數
for (int Tc_i = 0; Tc_i < str_date_rpt.Columns.Count + 1; Tc_i++)
{
testTableCell = new TableCell();
testTableRow.Cells.Add(testTableCell);
}
newTable.Rows.Add(testTableRow);
}
//this.Table1.Controls.Add(newTable);
#endregion
Table newTable = Table1;
//準備資料列及資料儲存格
System.Web.UI.WebControls.TableRow testTableRow;
System.Web.UI.WebControls.TableCell testTableCell;
//newTable.ID = "newTable_1";// + tbcount.ToString();
newTable.Attributes["runat"] = "server"; //
//2列
for (int TR_i = 0; TR_i < str_date_rpt.Rows.Count + 2; TR_i++)
{
testTableRow = new TableRow();
//2格 >按照站別動態給格數
for (int Tc_i = 0; Tc_i < str_date_rpt.Columns.Count + 1; Tc_i++)
{
testTableCell = new TableCell();
testTableRow.Cells.Add(testTableCell);
}
newTable.Rows.Add(testTableRow);
}
//this.Table1.Controls.Add(newTable);
#endregion
在原有的DataTable 中动态怎么样添加一行(C#)
假定你的datatable名为tblDatas,有Product、Version、Description三个字段
DataTable tblDatas = nowtable;
DataRow newRow;
newRow = tblDatas.NewRow();
newRow["Product"] = "水果刀";
newRow["Version"] = "2.0";
newRow["Description"] = "打架专用";
tblDatas.Rows.Add(newRow);
來源
DataTable tblDatas = nowtable;
DataRow newRow;
newRow = tblDatas.NewRow();
newRow["Product"] = "水果刀";
newRow["Version"] = "2.0";
newRow["Description"] = "打架专用";
tblDatas.Rows.Add(newRow);
來源
訂閱:
文章 (Atom)
Jenkins-mail
參考:http://www.linuxea.com/1767.html 前置作業略過~有空再補 Mailer Plugin post { success { emailext ( subject: &...
-
ASP.NET刷新頁面的六種方法 第一: private void Button1_Click( object sender, System.EventArgs e ) { Response.Redirect( Request.Url.ToSt...
-
foreach (string fname in System.IO.Directory.GetFileSystemEntries(@"C:\Users\joshs")) { //if (fn...