Mohan Gupta
What is using keyword in C#?
By Mohan Gupta in C# on Jun 10 2013
  • Ananth G
    Oct, 2016 21

    using keyword is used Remove unused memory form the objectUsing(SqlConnection objConn=new SqlConnection()) { }

    • 0
  • Smita Jagtap
    Jul, 2013 15

    There are two usage of "using" keyword 1. to import namespaces e.g using System;using System.IO; 2. to handle unmanaged resourcesAn object inside or outside the .NET Framework, which uses external code (For example: file handles, streams, DB connections). The Garbage Collector can't handle unmanaged resources, so we need to release them manually. e.g using (Stream input = File.OpenRead(filename)) {... } This can only be used with types that implement IDisposable.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS