![](/img/trans.png)
[英]'System.Data.SqlClient.SqlException' occurred in System.Data.dll but was not handled in user code Additional information: Incorrect syntax near ','
[英]Exception thrown: 'System.Data.SqlClient.SqlException' in System.Data.dll Additional information: Incorrect syntax near the keyword 'Table'
我的代码生成以下错误:
System.Data.dll中发生了类型为'System.Data.SqlClient.SqlException'的未处理的异常
附加信息:
')'附近的语法不正确。
我的代码是:
conn.Open();
SqlDataAdapter sda = new SqlDataAdapter("Update [Table] Set [Name]='" + textBox2.Text + "',[Course]='" + comboBox1.Text + "',[YearSection]='" + textBox3.Text + "' Where [Id]='"+textBox1.Text+"')", conn);
sda.SelectCommand.ExecuteNonQuery();
conn.Close();
MessageBox.Show("Updated Successfully !!!");
有人可以帮我了解为什么这不起作用。
在查询末尾删除)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.