Beispiel #1
0
        private void Save()
        {
            equipmentCRUDTableAdapter daEquipment = new equipmentCRUDTableAdapter();

            try
            {
                daEquipment.Update(dsEquipment.equipmentCRUD); // Call update method on the service adapter so it updates the table in memory ( All changes made are applied - CRUD)
                dsEquipment.AcceptChanges();                   // Call accept method on the dataset so it update the chanmges to the database

                lblStatus.Text = "Record Successfully Updated";
            }
            catch
            {
                dsEquipment.RejectChanges();
                lblStatus.Text = "Unable to Update Record";
            }
        }
Beispiel #2
0
        private void Save()
        {
            equipmentCRUDTableAdapter daEquipment = new equipmentCRUDTableAdapter();

            try
            {
                daEquipment.Update(dsEquipment.equipmentCRUD);
                dsEquipment.AcceptChanges();
                this.lblStatus.Text = "Equipment Created";
                Clear();
            }
            catch
            {
                dsEquipment.RejectChanges();
                this.lblStatus.Text = "Failed";
            }
        }