protected void Button1_Click(object sender, EventArgs e)
{
DataBase db = new DataBase();
string sqlStr = null;
for (int i = 0; i < 3; i++)
{
sqlStr = "update TitleThree set count=count+1 where choicename='结构合理'";
Response.Write(db.sqlExcuteInput(sqlStr).ToString());
}
}
为什么输出和结果为1 -1 -1
也就是说只执行成功了一次,这是怎么回事? 为什么不能循环执行SQL语句?
怎样才能这样循环执行SQL语句?