in Technology by

How do you use the “using” statement in C#?

1 Answer

0 votes
by
There are two ways to use the using keyword in C#. One is as a directive and the other is as a statement. Let's explain!
  1. using Directive 
    Generally, we use the using keyword to add namespaces in code-behind and class files. Then it makes available all the classes, interfaces and abstract classes and their methods and properties on the current page. Adding a namespace can be done in the following two ways:
  1. Using Statement 
    This is another way to use the using keyword in C#. It plays a vital role in improving performance in Garbage Collection.

Related questions

0 votes
    Why do we use Async and Await in C#?...
asked Jul 27, 2021 in Technology by JackTerrance
0 votes
    What do you mean by value types and reference types in C#?...
asked Jul 27, 2021 in Technology by JackTerrance
0 votes
    When should you apply “next” statement in R? When is it appropriate to use the “next” statement in R?...
asked Oct 16, 2020 in Technology by JackTerrance
0 votes
    Smriti wants to give output of a program in infinite loop which statement will you suggest to her to use? In qbasic Select the correct answer from above options...
asked Dec 21, 2021 in Education by JackTerrance
0 votes
    What is the Use of Dual-axis? How Do You Create One?...
asked Mar 30, 2021 in Technology by JackTerrance
0 votes
    “Entrepreneurs are born, not made.” Do you agree with this statement? Justify your answer. Please answer the above question....
asked Aug 23, 2022 in Education by JackTerrance
0 votes
    South Asia stands for diversity in every sense and yet constitutes one geo-political space. Do you agree with the ... for your answer. Select the correct answer from above options...
asked Aug 3, 2022 in Education by JackTerrance
0 votes
    What do you mean by danglimg if statement…..in simple language Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    When assigning a background color of a table cell on hover, the box shadow is covered. I have found ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    When assigning a background color of a table cell on hover, the box shadow is covered. I have found ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    I need to know how to use the delete_channel command in discord.py may someone please post a code sample ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 12, 2022 in Education by JackTerrance
0 votes
    I need to know how to use the delete_channel command in discord.py may someone please post a code sample ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 10, 2022 in Education by JackTerrance
0 votes
    How do you update the records with or without using Update Strategy?...
asked Mar 28, 2021 in Technology by JackTerrance
0 votes
    How do you push a file from your local system to the GitHub repository using Git?...
asked Oct 4, 2020 in Technology by Editorial Staff
0 votes
    How do I update the GUI from another thread in C#?...
asked Jan 16, 2021 in Technology by JackTerrance
...