本人为新手,在ASP.NET中尝试对GridView中的数据进行写入一个新表和更新原表时,只能更新和写入200多条后就提示超时了,请问有什么办法进行大批量的数据更新?下面是我自己写的,方法比较笨,麻烦给个简单的例子!!感谢
for (int i = 0; i < GridView1.Rows.Count; i++)
            {
                int 期末数 = Convert.ToInt32(GridView1.Rows[i].Cells[11].Text);
                double 期末成本 = Convert.ToDouble(GridView1.Rows[i].Cells[12].Text);
                string up = " update CW_JXC_stock set 期初数 ='" + 期末数 + "',月初成本 ='" + 期末成本 + "' where 货号=" + Convert.ToInt32(GridView1.Rows[i].Cells[0].Text);
                SqlDataReader odc = DataBaseHelper.GetReader(up);                string 货号 = GridView1.Rows[i].Cells[0].Text.ToString();
                string 品名 = GridView1.Rows[i].Cells[1].Text.ToString();
                string 规格 = GridView1.Rows[i].Cells[2].Text.ToString();
                string 单位 = GridView1.Rows[i].Cells[3].Text.ToString();
                string 类别 = GridView1.Rows[i].Cells[4].Text.ToString();
                string 期初数 = GridView1.Rows[i].Cells[5].Text.ToString();
                string 月初成本 = GridView1.Rows[i].Cells[6].Text.ToString();
                string 入库数 = GridView1.Rows[i].Cells[7].Text.ToString();
                string 进货成本 = GridView1.Rows[i].Cells[8].Text.ToString();
                string 出库数 = GridView1.Rows[i].Cells[9].Text.ToString();
                string 出库成本 = GridView1.Rows[i].Cells[10].Text.ToString();
                string 月末数量 = GridView1.Rows[i].Cells[11].Text.ToString();
                string 月末成本 = GridView1.Rows[i].Cells[12].Text.ToString();
                string 加权价 = GridView1.Rows[i].Cells[13].Text.ToString();
                string riqi = Convert.ToString(System.DateTime.Now.ToString("yyyy-MM"));                string strSql = "insert into JXC_History_Month_Report(日期,货号,品名,规格,单位,类别,期初数,月初成本,入库数,进货成本,出库数,出库成本,期末数,期末成本,加权价) values('" + riqi + "','" + 货号 + "','" + 品名 + "','" + 规格 + "','" + 单位 + "','" + 类别 + "','" + 期初数 + "','" + 月初成本 + "','" + 入库数 + "','" + 进货成本 + "','" + 出库数 + "','" + 出库成本 + "','" + 月末数量 + "','" + 月末成本 + "','" + 加权价 + "')";
                DataSet mydata = DataBaseHelper.GetDataSet(strSql);
                string rukubiao = "TRUNCATE TABLE CW_JXC_ruku";
                DataSet seta = DataBaseHelper.GetDataSet(rukubiao);
                string chukubiao = "TRUNCATE TABLE CW_JXC_chuku";
                DataSet setb = DataBaseHelper.GetDataSet(chukubiao);            }