top button
Flag Notify
Site Registration

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

+1 vote
185 views
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
...