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

Facebook Login
Site Registration

What is the use of “using” in C#?

+1 vote
17 views
What is the use of “using” in C#?
posted Apr 9, 2017 by Sachin

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

1 Answer

0 votes

We can use Using keyword in following ways:1. Generally we use Using keyword when we add any namespace in our class, code-behind files.. Like: Using System.IO;2. Secondly we can use Using keyword when an object need to destroy automatically. It can be used in ADO.NET, Entity Framework, Web Service call. Here system automatically closes/disposes the object. Like: Using(WCFService cc = new WCFService()) {cc.method(); }

answer Apr 10, 2017 by Vrije Mani Upadhyay
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
...