我想删除 datagridview 中的选定行并删除 Mysql 中的行。
private void deleteOrderButton_Click(object sender, EventArgs e)
{
int selectedIndex = orderDataGridView.CurrentCell.RowIndex;
if (selectedIndex > -1)
{
orderDataGridView.Rows.RemoveAt(selectedIndex);
orderDataGridView.Refresh();
}
string constring = "datasource=localhost;port=3306;username=admin;password=acw123";
string Query = "delete from database.tem_order where temp_orderID = ????
MySqlConnection conDatabase = new MySqlConnection(constring);
MySqlCommand cmdDataBase = new MySqlCommand(Query, conDatabase);
MySqlDataReader myReader;
conDatabase.Open();
myReader = cmdDataBase.ExecuteReader();
MessageBox.Show("Updated");
我在那里停留在MySql命令中;有人帮忙吗?