我的代码如下,按钮触发两个存储过程,但只有第一个执行了,第二个没反应,这是怎么回事?代码应该怎么改?
protected void Button5_Click(object sender, EventArgs e)
{
using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["stockConnectionString"].ConnectionString))
{
using (SqlCommand cmd = new SqlCommand("updatezhendang", con))
{
cmd.CommandTimeout = 1000;
cmd.CommandType = CommandType.StoredProcedure;
con.Open();
cmd.ExecuteNonQuery();
}
using (SqlCommand cmdd = new SqlCommand("bugupdate", con))
{
cmdd.CommandTimeout = 1000;
cmdd.CommandType = CommandType.StoredProcedure;
con.Open();
cmdd.ExecuteNonQuery();
}
}
}