日期:2014-05-17  浏览次数:21213 次

求助insert into values提示我对象名“用户”无效,或者values附近有语法错误
小弟刚接触C#和SQL求众位大神帮忙解决一下这问题,红色部分,老是错误,提示对象名“用户”无效

private void button1_Click_1(object sender, EventArgs e)
        {
            if ((textBox1.Text.Length >= 4) && (textBox1.MaxLength <= 12) && (textBox2.Text.Length >= 6) && (textBox3.Text.Length >= 6))
            {
                flagRegister = true;
            }
            else
            {
                if ((textBox1.Text.Length < 4) || (textBox1.Text.Length > 12))
                {
                    MessageBox.Show("用户名长度不在约定范围内,请重新输入!","提示");
                    return;
                }
                if (textBox2.Text.Length < 6)
                {
                    MessageBox.Show("密码长度不足6位,请重新输入!","提示");
                    return;
                }
                if (textBox3.Text.Length < 6)
                {
                    MessageBox.Show("请重新输入邮箱!","提示");
                    return;
                }
            }//判断用户名条件
            if (UserFlag == true)
            {
                MessageBox.Show("用户名已经存在,请重新输入!");
                return;
            }
            if (flagRegister == true)//确认用户注册后,把用户写入数据库
            {
                SqlConnection&nb