private void btnDelete_Click(object sender, EventArgs e)//删除数据库内计量单位 { string str = "delete from DMetric where MetricCode = '" + label5.Text + "' and " + "MetricName = '" + label6.Text + "' and UnitID = " + Eid; try { FormMetric form = (FormMetric)this.Owner; db.SetPIVAsDB(str); form.deleteRow(); this.DialogResult = DialogResult.OK; this.Close(); } catch (System.Exception ex) { MessageBox.Show(ex.Message); } }