cmd.CommandText = "update 费率表 set 充值金额='" + textBox3.Text + "',赠送金额='" + textBox4.Text + "' where 编号=1 and 充值金额='" + textBox6.Text + "',赠送金额='" + textBox5.Text + "' where 编号=2 and 充值金额='" + textBox8.Text + "',赠送金额='" + textBox7.Text + "' where 编号=3";
这个有什么错误

解决方案 »

  1.   

    cmd.CommandText = "update 费率表 set 充值金额='" + textBox3.Text + "',赠送金额='" + textBox4.Text + "' where 编号=1;update 费率表 set 充值金额='" + textBox6.Text + "',赠送金额='" + textBox5.Text + "' where 编号=2;update 费率表 set 充值金额='" + textBox8.Text + "',赠送金额='" + textBox7.Text + "' where 编号=3";
    改成上面那样,注:要Sql Server才行
      

  2.   


    我用的是access数据库  这样不行  试了
      

  3.   

    那就分开做cmd.CommandText = "update 费率表 set 充值金额='" + textBox3.Text + "',赠送金额='" + textBox4.Text + "' where 编号=1";
    cmd.NonQuery()
    cmd.CommandText = "update 费率表 set 充值金额='" + textBox6.Text + "',赠送金额='" + textBox5.Text + "' where 编号=2";
    cmd.NonQuery()
    cmd.CommandText = "update 费率表 set 充值金额='" + textBox8.Text + "',赠送金额='" + textBox7.Text + "' where 编号=3";
    cmd.NonQuery()
      

  4.   

    StringBuilder 拼装3条update语句,然后抛给事物去执行