public void Delete(int CustomerID) { using (tempdbEntities tde = new tempdbEntities()) { tde.pDelCustomer(CustomerID); } }
private void buttonDelete_Click(object sender, EventArgs e) { try { using (tempdbEntities tde = new tempdbEntities()) { tde.pDelCustomer(Int32.Parse(textBoxDeleteCustomerID.Text)); } textBoxDeleteCustomerID.Clear(); } catch (Exception) { MessageBox.Show("Could not delete data"); } }