public static int DeleteCustomerAddresses(int id) { using (SqlConnection con = new SqlConnection(connString, credentials)) { try { Dictionary <string, object> p = new Dictionary <string, object> { { "@Id", id } }; string cmdText = "DELETE " + "FROM CustomerAddress " + "WHERE CustomerId = @Id"; con.Open(); return(DBActions.ExecNonReaderQR(con, cmdText, p)); } catch (Exception ex) { MessageBox.Show(ex.Message); return(-1); } finally { con.Close(); } } }