public void location_delete(int ID)
 {
     location.Delete(ID);
     Insert_location_GridView.DataBind();
     Update_location_GridView.DataBind();
     Delete_location_GridView.DataBind();
 }
Пример #2
0
        private void buttonDelete_Click(object sender, EventArgs e)
        {
            //Get  Data from the textboxes
            m.ID = int.Parse(textBoxNID.Text);

            bool success = m.Delete(m);

            if (success == true)
            {
                //Deleted Successfully
                MessageBox.Show("The Data deleted successfully");

                //Load Data on DataGridVeiw
                DataTable dt = m.Select();
                dataGridView3.DataSource = dt;
            }
            else
            {
                //Failed to Delete
                MessageBox.Show("Failed to delete data Try Again...");
            }
        }