为什么我的c#代码会显示列名无效,哪一位大神可以帮忙解决一下?
string sql;if (Insert_flag)
{
sql = "Insert into Course(cno,cname,cdept,tno,tname,cpno,ccredit) values('" + cno_textBox2.Text + "','" + cname_textBox3.Text + "','" + cdept_textBox4.Text +
"','" + tno_textBox5.Text + "','" + tname_textBox6.Text + "','" + cpno_textBox7.Text + "','" + ccredit_textBox8.Text + "')";
}
else
{
sql = "update course set cno='" + cno_textBox2.Text + "',cname='" + cname_textBox3.Text + "',cdept='" + cdept_textBox4.Text + "',tno='" + tno_textBox5.Text +
"',tname='" + tname_textBox6.Text + "',cpno='" + cpno_textBox7.Text + "',ccredit='" + ccredit_textBox8.Text + "' where cno = " + ((DataRowView)courseBindingSource.Current)["cno"].ToString();