Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6753821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:12:27+00:00 2026-05-26T13:12:27+00:00

look at these two codes First: Slide _Slide = DataContext.Slides.SingleOrDefault(rec => rec.Id == _SlideObj.Id);

  • 0

look at these two codes

  1. First:

    Slide _Slide = DataContext.Slides.SingleOrDefault(rec => rec.Id == _SlideObj.Id);
    _Slide = _SlideObj;            
    DataContext.SaveChanges();
    
  2. Second:

    Slide _Slide = DataContext.Slides.SingleOrDefault(rec => rec.Id == _SlideObj.Id);
    _Slide.Title = _SlideObj.Title;
    _Slide.Description = _SlideObj.Description;
    DataContext.SaveChanges();
    

The first code does not update the database but the second updates. Why? How can I change my code to do update operation in first method? (I like to use first method)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:12:28+00:00Added an answer on May 26, 2026 at 1:12 pm

    There is no update because you didn’t change anything. In the first case, you just changed _Slide to point to a different Slide.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

These two may look like they have no correlation but bear with me! In
have a look at the top menu on these two pages on Firefox: http://outsidemma.com/2010/100031-bj-penn-the-prodigy-jay-dee.php
This is a follow-up question to this one . Take a look at these
I want to draw a graph in my Django-based site, to look like these
I understand it's a standard practice to look at both these variables. Of course
I'm reading about visual programming languages these days. So I've thought up two paradigms.
I've two for loops that basically look up in two different arrays (each having
I have two tables: who contains these fields: gmdc_employee file_id company_id employee_id employee_name file_description
Please have a look at this code: Card *first = [[Card alloc] initWithFace:@Ace andSuit:@Hearts];
I have two Person and PersonDTO classes and I'm using NHibernate to save these

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.