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 7568591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:57:53+00:00 2026-05-30T14:57:53+00:00

I am using this code sample from here.. http://msdn.microsoft.com/en-us/data/gg685489 [HttpPost] public ActionResult Edit(int id,

  • 0

I am using this code sample from here.. http://msdn.microsoft.com/en-us/data/gg685489

[HttpPost]
    public ActionResult Edit(int id, Blog blog)
    {
        try
        {
            using (var db = new BlogDataEntities())
            {
                db.Entry(blog).State = System.Data.EntityState.Modified;
                db.SaveChanges();
                return RedirectToAction("Index");
            }
        }
        catch
        {
            return View();
        }
    }

I am having difficulty in implementing the above code – the example assumes using EF 4.1 and I was on older version. I later upgraded my EF version to 4.3 and I still am not able to do this. I accessed nuget package and installed it from there. I checked the references and EF version is comfirmned to be 4.3… even after the new install of EF, intellisense does not show me the “db.entry” option….can any one tell me if if i am missing another step here… thank you.

  • 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-30T14:57:54+00:00Added an answer on May 30, 2026 at 2:57 pm

    If you are not using Code First, then the default data context is ObjectContext (rather than DbContext which your code is designed to use). If you are using ObjectContext then you’ll want to do this instead:

    http://msdn.microsoft.com/en-us/library/bb896248.aspx

    However I recommend right clicking in your model and ‘add code generation item’ and add the DbContext template. This will then convert your object context into dbcontext and allow you to access entry as you are trying to code it. Either one will work, but DbContext has a much easier API to work with.

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

Sidebar

Related Questions

I downloaded a sample code from here: http://gallery.expression.microsoft.com/ShowHideWithFlip Now my problem is that i'm
I'm using the WindowsMedia library found here: http://www.ernzo.com/soundstudio.aspx The sample code had the ability
This is a XAML code sample taken from the MSDN library article for the
I am using an example program from this code http://sicktoolbox.sourceforge.net/ > http://sourceforge.net/projects/sicktoolbox/files/ . It's
While using this code to serialize an object: public object Clone() { var serializer
When using this code (simplified for asking): var rows1 = (from t1 in db.TABLE1
I'm working with a C# sample application (taken from here : http://www.piccoder.co.uk/content/view/42/26/1/4/ ) The
I am using this code: def req(url, postfields): proxy_support = urllib2.ProxyHandler({http : 127.0.0.1:8118}) opener
Here is sample code that I'm working with. def index(request): flow = OAuth2WebServerFlow( client_id='xyz.apps.googleusercontent.com',
I'm trying to draw a textured quad in XNA using the sample code from

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.