我有一个带有删除按钮的Windows窗体,我试图从网格中删除一行并将其从数据库中删除。以下代码从网格中删除,但如何从数据库中删除它?
private void deleteButton_Click(object sender, EventArgs e)
{
foreach (DataGridViewCell oneCell in employeeGrid2.SelectedCells)
{
if (oneCell.Selected)
{
employeeGrid2.Rows.RemoveAt(oneCell.RowIndex);
}
}
}