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

  • Home
  • SEARCH
  • 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 7489651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:20:47+00:00 2026-05-29T15:20:47+00:00

In many cases when working with different types of data objects it’s important to

  • 0

In many cases when working with different types of data objects it’s important to dispose of them to make sure that they don’t leave a database connection open. However, table adapters don’t seem vulnerable to this problem because they are built on the principle of disconnected data. I am under the impression that a table adapter will always close it’s connection after the atomic Fill or Update method has completed, even in the presence of exceptions. Is this correct?

On the other hand, table adapters do implement IDisposable, so there must be some unmanaged resources to clean up at some point, right? Or is this just ceremony so that people can write:

using(var a = new MyTableTableAdapter())
{
    a.Fill(ds.MyTable);
}

and not have to think about this topic?

  • 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-29T15:20:48+00:00Added an answer on May 29, 2026 at 3:20 pm

    If it implements IDisposable it either currently holds resources to dispose of or may in the future. If it’s disposable, you should dispose it. It’s not for you to understand it’s internals – only to understand it’s contract and honor it. Typically, folks don’t do things out of ceremony – “using” is cool syntactical sugar but not cool enough to start sprinkling IDisposable around classes that don’t have resource to dispose of 🙂

    Also, IDisposable doesn’t necessarily mean “unmanaged” resources. It means there are resources (like file handles, network connections etc…) that are not objects that are garbage collected (memory). The distinction is cleaning up something not collected – not unmanaged. It just so happens that often many of those resources are backed by unmanaged OS resources.

    EDIT:

    For example, let’s say I created a completely managed object that retrieved some other objects from a pool (cache) on demand and when you’re done using it, I want it to put those objects back into the shared pool (not freed – an explicit call to add something to a pool. Nothing unmanaged here but I could pull objects from the pool on demand and in dispose I could put them back (Pool.Add) for others to use. You the consumer would simply “use” my object and know it will clean up when disposed. The explicit dispose is needed because we shouldn’t wait for finalize (it may happen way later or not at all) –

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

Sidebar

Related Questions

I'm using c#. In many cases I'm writing code that can benefit from a
I am working on an ASPX page that needs to handle multiple different kinds
I'm sure that this question has been addressed in many best practices books, but
I am seeing many many different use cases where I could use Markdown in
I am working on a project that was originally created by someone else, they
I have been creating and working on different websites. Many a times a get
This can be applied to many different languages, but I am specifically working with
I know there are many cases which are good cases to use multi-thread in
First of all, there are many cases where Sleep() is misused , for example
In Python scripts, there are many cases where a keyboard interrupt (Ctrl-C) fails to

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.