[转载]datatable中只取前7条数据

      DataTable dt1 = new DataTable();
            //然后通过sql语句绑定到dt
            DataTable dt2 = new DataTable();
            dt2 = dt1.Clone();
            for (int k = 0; k < 7; k++)
            {
                dt2.Rows.Add(dt1.Rows[k]);
            }

posted on 2018-01-02 09:45  New_q  阅读(156)  评论(0编辑  收藏  举报

导航