为什么这段代码会出现{"',' 附近有语法错误。"} 在 这句da.ExecuteNonQuery()
string txt1 = "Data Source=pc2011091520fha;DataBase=学生;Integrated Security=SSPI;User Instance=False";SqlConnection conn = new SqlConnection(txt1);
string txt2 = "Insert Into 学生信息表(学号,姓名,性别,政治面貌,籍贯,手机)Values('";
txt2 += textBox1.Text + "','";
txt2 += textBox2.Text + "','";
txt2 += comboBox2.Text + "','";
txt2 += comboBox1.Text + "','";
txt2 += textBox5.Text + "','";
txt2 += textBox6.Text + "')";
conn.Open();
SqlCommand da=new SqlCommand (txt2,conn);
da.ExecuteNonQuery();
textBox1.Text = "";
textBox2.Text = "";
comboBox2.Text = "";
comboBox1.Text = "";
textBox5.Text = "";
textBox6.Text = "";
MessageBox.Show("添加成功!");
da.Dispose();
conn.Close();