#c# #mysql
Вопрос:
Мне нужна помощь с запросом, связанным с 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
Ответ №1:
Запрос изменяется на
DELETE FROM customer WHERE customerId=customerId;
Это полностью удаляет строку, и приложение работает так, как задумано.