日期:2014-05-17 浏览次数:20984 次
public void setProApply()
{
string str1 = ConfigurationManager.ConnectionStrings["SQLserver"].ConnectionString;
conn1 = new SqlConnection(str1);
conn1.Open();
for (int r = 0; r < dt.Rows.Count; r++)
//for (int r = dt.Rows.Count - 1; r >= 0; r--)
{
for (int m = 1;m <= Convert.ToInt32(dt.Rows[r][3].ToString());m++)
{
string sql1 = "insert into table([a],[b],[c],[d],[e],[f],[g],[h])" +
"values('" + a + "','" + txt_b.Text.ToString() + "','" + txt_c.Text.ToString() + "','" + dt.Rows[r][2].ToString() + "','" + txt_e.Text.ToString() + "','" + txt_f.Text.ToString() + "'," +
"'" + dt.Rows[r][4].ToString() + "','等待处理')";
comm1 = new SqlCommand(sql1, conn1);
try
{
comm1.ExecuteNonQuery();
}
catch (SqlException)
{
Response.Write("<script language=javascript>window.alert('信息添加失败!');</script>");
}
&nbs