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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:43:09+00:00 2026-05-15T06:43:09+00:00

Looking at Code First in ADO.Net EF 4 CTP 3 and wondered how the

  • 0

Looking at Code First in ADO.Net EF 4 CTP 3 and wondered how the SqlConnection in their walkthrough is disposed. Is that the responsibility of ContextBuilder? Is it missing from the example?

  var connection = new SqlConnection(DB_CONN);
  var builder = new ContextBuilder<BloggingModel>();
  var connection = new SqlConnection(DB_CONN);

  using (var ctx = builder.Create(connection))
  {
      //... 
  }
  • 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-15T06:43:10+00:00Added an answer on May 15, 2026 at 6:43 am

    I just realized that I can add an event handler to ObjectContext.Disposing and resolve this.

    In CTP 3 at least, Connection is not disposed when the ObjectContext is disposed.

    Since I’m subclassing ObjectContext already, I implemented IDisposable in my subclass and call Connection.Dispose() from there.

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

Sidebar

Related Questions

I'm looking for the code in the linux kernel (2.4.x) that initializes the first
i am looking for code that can generate an array where the first item
I'm interested in speed, not good looking code, that is why I'm using array
I am looking to code me a banner management system that has users make
I was looking at code that implemented the ICloneable interface for one of the
This is my first attempt to read an Excel 2007 file via ADO.net, and
Have an existing C# .NET code base that is currently coded to directly access
Looking to deepen my knowledge of ADO.NET - while reading through the Enterprise Library
Just started looking into Entity Framework and the new Code-First features. My question is
I have a user class in EF Code First that contains a lot of

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.