0
我如何使用C#中的datagridview中的MYSQL刪除數據SELECTED(CHECKED)?C#DatagridVIew刪除SQL日期
我的代碼:
string CONFIG = "server=localhost;userid=root;password=admin;database=program";
MySqlConnection cone = new MySqlConnection(CONFIG);
MySqlCommand query2 = new MySqlCommand();
query2.Connection = cone;
query2.CommandText = "DELETE FROM TABLE WHERE ID = @ID";
// I believe the key from this problem stay in line below//
query2.Parameters.AddWithValue("@ID", gridMovie.SelectedRows);
cone.Open();
query2.ExecuteNonQuery();
cone.Close();