你试着改成这样看行不行
if (this.textBox2.Text == null){
MessageBox.Show("用户名称不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.textBox2.Focus();
}
else if (this.textBox4.Text == null)
{
MessageBox.Show("水表名称不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.textBox4.Focus();
}
else
{
mybase.getcom("update sbxx set dwmc='" + this.textBox2.Text.Trim() + "',sbmc='" + this.textBox4.Text.Trim()
+ "',yhlx='" + this.comboBox2.Text.Trim() + "',sblx='" + this.comboBox1.Text.Trim()
+ "',Phone='" + this.textBox3.Text.Trim() + "',dizhi='" + this.textBox5.Text.Trim()
+ "',zzs='" + this.comboBox3.Text.Trim() + "' where dwbh = '" + this.textBox1.Text.Trim() + "' and sbbh='" + this.textBox6.Text.Trim() + "'");
this.button1_Click(sender, e);
MessageBox.Show("水表用户信息修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}