具有多个依赖项的C#MySql Workbench Db DELETE查询参数.AddWithValue?我知道这是错误



我需要帮助查询是否连接到DGV和CellClick fullrow。我需要执行将删除所选行的查询。

MySqlCommand cmd6 = con.CreateCommand(); connection to mysql workbench

//query that is not working and I can't find any explanation how to do it.
cmd6.CommandText = "DELETE FROM customer WHERE customerId=@customerId(NULL auto-increment), customer=@customerName, customer=@addressId,customer=@active,customer=@createDate, customer=@createdBy, customer=@lastUpdate, customer=@lastUpdatedBy "; 
cmd6.Parameters.AddWithValue("@customerName", textBox1Name.Text);//those are good and working just the query is not working.
cmd6.Parameters.AddWithValue("@customerId", AddCustomerForm.SetValueForcustomerId);//working as well just the query 

查询更改为

DELETE FROM customer WHERE customerId=customerId; 

这将完全删除该行,应用程序将按设计工作。

最新更新