title: An error occurred while updating the entries. See the inner exception for details
body: <p>When i delete an item in a listbox, i get the error in the question as shown in the screenshot below:
  <img src="https://i.stack.imgur.com/xlcQZ.png" alt="error"></p>
  
  <p>I do not know where the inner exception is, but i tried try, catch but i got the same error in the question.</p>
  
  <p>Here is all of the code :</p>
  
  <pre><code>namespace WpfApplication7
   {
  /// &lt;summary&gt;
  /// Interaction logic for Edit_Rooms.xaml
  /// &lt;/summary&gt;
  public partial class Edit_Rooms : Window
  {
      public Edit_Rooms()
      {
          InitializeComponent();
      }
  
      //initialises entities
      WpfApplication7.AllensCroftEntities1 allensCroftEntities1 = new WpfApplication7.AllensCroftEntities1();
      private Room ObjectIndex;
  
      private void Window_Loaded(object sender, RoutedEventArgs e)
      {
          // Load data into Rooms. 
          System.Windows.Data.CollectionViewSource roomsViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("roomsViewSource")));
          //runs a query to go the roomsQuery to get the rooms table from the entities
          System.Data.Objects.ObjectQuery&lt;WpfApplication7.Room&gt; roomsQuery = this.GetRoomsQuery(allensCroftEntities1);
          //used when adding new rooms
          roomsViewSource.Source = roomsQuery.Execute(System.Data.Objects.MergeOption.AppendOnly);
      }
  
      private System.Data.Objects.ObjectQuery&lt;Room&gt; GetRoomsQuery(AllensCroftEntities1 allensCroftEntities1)
      {
          System.Data.Objects.ObjectQuery&lt;WpfApplication7.Room&gt; roomsQuery = allensCroftEntities1.Rooms;
          // Returns an ObjectQuery.
          return roomsQuery;
      }
  
      private void btnDelete_Click(object sender, RoutedEventArgs e)
      {
          //prevents user trying to delete nothing/unselected row
          if (ObjectIndex == null)
          {
              MessageBox.Show("Cannot delete the blank entry");
          }
          else
          {
                  //deletes object from dataset, saves it and outputs a message
                  allensCroftEntities1.DeleteObject(ObjectIndex);
                  allensCroftEntities1.SaveChanges();
                  MessageBox.Show("Room Deleted");
          }
      }
  
      private void btnSave_Click(object sender, RoutedEventArgs e)
      {
          try
          {
              //attempts to save changes
              allensCroftEntities1.SaveChanges();
              MessageBox.Show("Saved");
          }
          catch (Exception ex)
          {
              //if unsuccessful, outputs an error message
              MessageBox.Show(ex.ToString());
          }
      }
  
      private void btnFirst_Click(object sender, RoutedEventArgs e)
      {
          listbox.SelectedIndex = 0;
      }
  
      private void btnPrevious_Click(object sender, RoutedEventArgs e)
      {
          //prevents user going to the previous item before the first item
          if (listbox.SelectedIndex &gt; 0)
          {
              listbox.SelectedIndex -= 1;
          }
      }
  
      private void btnNext_Click(object sender, RoutedEventArgs e)
      {
          //prevents user going after last item and throwing up an error
          if (listbox.SelectedIndex &lt; listbox.Items.Count)
          {
              listbox.SelectedIndex += 1;
          }
      }
  
      private void btnLast_Click(object sender, RoutedEventArgs e)
      {
          listbox.SelectedIndex = listbox.Items.Count - 1;
      }
  
      private void listbox_SelectionChanged(object sender, SelectionChangedEventArgs e)
      {
          //outputs index of the selected room
          ObjectIndex = listbox.SelectedItem as Room;
      }
  }
  }
  </code></pre>