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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:31:17+00:00 2026-05-24T06:31:17+00:00

this is basically a tutorial question to ask since am a beginner I would

  • 0

this is basically a tutorial question to ask since am a beginner I would like to what is a difference between the using statement we use at start of our C# code to include assembly and namespaces

like this:

using System.Web.Services;

and when we write inside the code within the method or code.
like this:

using (SqlDataAdapter adapter = new SqlDataAdapter(cmd))

is there any difference or they both are same, any guidance would be helpful and appreciated.

  • 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-24T06:31:17+00:00Added an answer on May 24, 2026 at 6:31 am

    The first (Using Directive) is to bring a namespace into scope.

    This is for example, so you can write

    StringBuilder MyStringBuilder = new StringBuilder();
    

    rather than

    System.Text.StringBuilder MyStringBuilder = new System.Text.StringBuilder();
    

    The second (Using Statement) one is for correctly using (creating and disposing) an object implementing the IDisposable interface.

    For example:

    using (Font font1 = new Font("Arial", 10.0f)) 
    {
        byte charset = font1.GdiCharSet;
    }
    

    Here, the Font type implements IDisposable because it uses unmanaged resources that need to be correctly disposed of when we are no-longer using the Font instance (font1).

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

Sidebar

Related Questions

Excuse the question title, couldn't think how to describe this.. Basically, using a few
This is basically a duplicate of this question , but the accepted answer was
This is basically the same question as Click items in select box, and then
Basically this is a question how to access local scope handler. I trying to
I hate to ask this question on this forum, but I'm having a lot
This is a fairly simple question. Basically, I'm having a program send HardWare ID's
Basically, I would like a brief explanation of how I can access a SQL
I hope this question makes sense. Basically, I am looking for a set of
I'm using the code from this tutorial to create a UIScrollView which allows scrolling
I'm trying to build a real-world app using this tutorial as a basis for

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.