top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

What is the importance of Using Statement and Using Keyword in C#?

0 votes
31 views
What is the importance of Using Statement and Using Keyword in C#?
posted May 12, 2017 by Rohini Agarwal

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

0 votes

In C# , Usinf can be used in two ways:

1. As a directive where it's behavior will be as inclusion of namespace e.g

using System;

using System.IO;
  1. As a statement which can be used only with types that implements IDisposable interface e.g.

    ``using( SQLDataRedaer dr=cmd.ExecuteReader())
    {
    while(dr.Read());
    }

answer May 15, 2017 by Shweta Singh
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...