62,266
社区成员
发帖
与我相关
我的任务
分享
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
SqlConnection con = database.returncon();
int i = 0;
SqlCommand cmd1 = new SqlCommand(System.Configuration.ConfigurationManager.AppSettings["DownLoad"], con);
SqlDataReader sda1 = cmd1.ExecuteReader();
TableRow tr = new TableRow();
while (sda1.Read())
{
i += 1;
TableCell td = new TableCell();
Control c = this.LoadControl("DownLoadControl.ascx");
PropertyInfo pi = c.GetType().GetProperty("D_ID",typeof(int));
if(pi != null)
pi.SetValue(c,sda.GetInt32(0),null);
td.Controls.Add(DC);
tr.Controls.Add(td);
if (i % num == 0)
{
this.TabShow.Rows.Add(tr);
tr = new TableRow();
}
}
if (i % num != 0)
{
this.TabShow.Rows.Add(tr);
}
sda1.Close();
con.Close();
}
}
Control control = (Control)LoadControl("DownLoadControl.ascx");