top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

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

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

Share this question
Facebook Share Button Twitter Share Button LinkedIn 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
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.