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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:07:20+00:00 2026-06-04T17:07:20+00:00

I have a small confusion with the IDisposable interface and the using keyword in

  • 0

I have a small confusion with the IDisposable interface and the using keyword in C# on which classes we could use it.

using (DataSet studentDS = GetMyStudentDS())
{
    // here comes some code
}

I found that Classes inherited from DataSet class are not finalized by the garbage collector, if so is it a good practice to put that in the using block so that it is done manually once its job is done. could someone brief it for the benefit of all. Thanks.

  • 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-06-04T17:07:22+00:00Added an answer on June 4, 2026 at 5:07 pm

    is it a good practice to put that in the using block

    Yes it is. As DataSet implement IDisposible interface. DataSet extends MarshalByValueComponent class. MarshalByValueComponent class implements IDisposable.

    Any derived type will also have IDisposable implemented. If it does not explicitly implements (in other words override IDisposable.Dispose), base method (DataSet.Dispose) will be called.

    Regarding the Finalizer, that is a separate concept to make sure that unmanaged resources are cleaned up even if developer fails to call the Dispose method (or forgets using block).

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

Sidebar

Related Questions

I have a small program that which is confusing me. I am trying using
I have a small problem in coding confusion 3x3 matrix by using matlab... I
I have small database of business and their addresses. Using the Google Geocode API
I have small game engine written in c++. I'm considering using some features of
I have small library i want to use for creating games. First, i tried
I have a small confusion in the dynamic memory allocation concept. If we declare
I have written a small app which links against libraries released under the LGPL.
All, I Have a small confusion about Case sensitivity of ODBC DSN names. Say,
I have a small confusion in my application. How can I check whether an
I have a small question which is confusing me, I have a variable 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.