日期:2014-05-17 浏览次数:21295 次
private void btn_Del_Click(object sender, EventArgs e)
{
if (MessageBox.Show("确认要删除吗?", "删除后不可恢复", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
Current = dataGridView1.CurrentCell.RowIndex; //当前选中行
string strID = dataGridView1.Rows[Current].Cells[12].Value.ToString().Trim();
string strSql = "delete from gps where cstr(编号)=" + strID ;
OleDbConnection conn = GetConnection();
try
{
conn.Open();
OleDbCommand cmd = new OleDbCommand(strSql, conn);
int a = cmd.ExecuteNonQuery();
conn.Close();
}
catch (Exception ex)
{
throw ex;
}
}
Admin_Activated(null, null);
}