.Net Frequently Asked Questions (C#, Asp.Net and VB.Net)
The following sections contains Frequently Asked Questions (Latest and authentic Interview questions) about Microsoft .NET Framework and its related technologies including Asp.Net, C# and VB.Net.
What is the use of using statement in C# ?

Placing your code inside a using block ensures that it calls Dispose() method after the using-block is over, even if the code throws an exception.
Example:
is same as
C# Using Statement Calls Dispose

In the above code blocks, the second code block is uses the "using" statement, so in this case the objects are disposed as soon as control leaves the block. It provides a convenient syntax that ensures the correct use of IDisposable objects, also we can see implementing using is a of way shorter and easier to read.
Working Example
Using using statement

Here we can understand using block is used to acquire a resource and use it and then it automatically dispose of when the execution of block completed. Here we can see it simplifies the code that you have to write to create and then finally clean up the Object. More..... Frequently Asked Questions
- C# Root Class
- C# DateTime to null
- Convert string to int in C#
- String and System.string
- Dictionary in C#
- String to byte Array
- Detecting arrow keys
- Enum with Switch.Case
- Passing Data
- Autocomplete TextBox
- Autocomplete ComboBox
- Convert enum to List
- MemoryStream to file
- Parse XML - XmlReader
- Parse XML - XmlTextReader
- Parse XML - XmlDocument
- File.Exists Method
- Decimal vs Double vs Float
- String to DateTime
- ComboBox text and value
- sort array
- Image to Byte Array
- Numeric Only TextBox Control
- NullReferenceException
- Custom Exception
- Throwing Exceptions
- String Vs StringBuilder
- ByteArray from Stream
- Remove spaces from string
- Remove new line from a string
- Remove non alphanumeric
- Character Encoding
- Connect C# to MySQL
- Byte array to string
- What is an IP Address ?
- Running a .BAT file
- Rounding to 2 Decimal Places
- Multiple Lines String
- Encryption and Decryption
- Datatype of a variable
- Aautoscroll multiline TextBox
- Difference between forEach and for loop
- Convert byte array to hex string
- Catch multiple exceptions at once: C#