出现问题ContactsAdd没有采用“10”个参数的重载
我是个菜鸟~在改其他人的程序~出现问题ContactsAdd没有采用“10”个参数的重载~我知道问题原因是要求参数个数与你传入个数不同
不过我想不要那最后一个参数 应该怎么改?
private void button10_Click(object sender, EventArgs e)//添加
{
if (textBox1.Text != "" &&comboBox1.Text != "" && comboBox2.Text != "")
{
if (op.ContactsAdd(this.textBox1.Text, this.comboBox1.Text, this.dateTimePicker1.Text, this.comboBox2.Text, this.textBox7.Text, this.textBox8.Text, this.textBox3.Text, this.textBox5.Text, this.textBox4.Text, this.textBox9.Text ) == true)
{
MessageBox.Show("添加成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("添加失败", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
} --------------------编程问答-------------------- 在参数列表里增加一个空的参数,或者重载函数 --------------------编程问答-------------------- --------------------编程问答-------------------- 求大神帮忙修改下好么 --------------------编程问答-------------------- ContactsAdd()把这个方法贴出来吧,看看最后一个参数的值是怎么判断的,然后你根据它的判断传值。
例如:if(par10 !=null)
那么你在前台就传null,关键还在于方法里面的判断,根据判断去传参数,确保不会出现问题。 --------------------编程问答--------------------
补充:.NET技术 , ASP.NET