将一个datatable添加到一个新datatable Code 1 //绑定行业资讯 2 NewsListBll newsBll = new NewsListBll(); 3 DataTable dt = newsBll.GetList(6, "news_type=1", "createtime desc").Tables[0]; 4 DataTable dt2 = new DataTable(); 5 dt2.Columns.Add("News_ID"); 6 dt2.Columns.Add("News_Type"); 7 dt2.Columns.Add("News_Title"); 8 dt2.Columns.Add("News_Logo"); 9 dt2.Columns.Add("News_Content");10 dt2.Columns.Add("Scan_Count");11 dt2.Columns.Add("Issue_User");12 dt2.Columns.Add("CreateTime");13 dt2.Columns.Add("IsPicNews");14 dt2.Columns.Add("IsRecommend");15 dt2.Columns.Add("Available");16 if (dt.Rows.Count > 0)17 {18 strHYZX = "<h3>" + dt.Rows[0]["News_Title"].ToString() + "<p>" + dt.Rows[0]["News_Content"].ToString() + "</p><span><a href='#'>[详细]</a></span></h3>";19 for (int i = 1; i < dt.Rows.Count; i++)20 {21 DataRow dr2 = dt2.NewRow();22 dr2 = dt.Rows[i];23 dt2.ImportRow(dr2);24 }25 repHYZX.DataSource = dt2;26 repHYZX.DataBind();27 } posted on 2009-11-04 11:14 搏击的小船 阅读( ...) 评论( ...) 编辑 收藏 转载于:https://www.cnblogs.com/guanjie20/archive/2009/11/04/1595819.html