导航

这样写

Posted on 2011-04-09 21:17  beeone  阅读(239)  评论(0编辑  收藏  举报

private void button1_Click(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("c1");
            dt.Columns.Add("c2");
            dt.Columns.Add("c3");
            dt.Columns.Add("c4");
            dt.Columns.Add("c5");
            dt.Columns.Add("c6");
            dt.Columns.Add("c7");
            dt.Columns.Add("c8");
            dt.Columns.Add("c9");
            dt.Columns.Add("c10");

            DataRow dr;

            for(int i = 0 ;i < numericUpDown1.Value; i ++)
            {
                dr = dt.NewRow();
                dr[0] = string.Format("1-{0}", i%100 + 1);
                dr[1] = string.Format("2-{0}", i%100 + 1);
                dr[2] = string.Format("3-{0}", i%100 + 1);
                dr[3] = string.Format("4-{0}", i % 100 + 1);
                dr[4] = string.Format("5-{0}", i % 100 + 1);
                dr[5] = string.Format("6-{0}", i % 100 + 1);
                dr[6] = string.Format("7-{0}"