---
title: "Use of Using Keyword in C#"  
description: "We use “Using” keyword as directive in c#. “Using” keyword can be used for importing namespace to your classes.      Example:Using System;    Using Sy"  
author: "AVADHESH PATEL"  
published: 2013-01-17  
updated: 2014-09-18  
canonical: https://www.mindstick.com/blog/431/use-of-using-keyword-in-c-sharp  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Use of Using Keyword in C#

We use “Using” [keyword](https://www.mindstick.com/forum/33572/sql-inner-join-keyword) as directive in c#. “Using” keyword can be used for importing [namespace](https://www.mindstick.com/articles/12552/namespace) to your classes.\

##### Example:

Using [System](https://www.mindstick.com/articles/23411/the-most-effective-method-to-find-the-perfect-small-business-phone-system-for-your-business);

Using System.Data;

Another most [useful](https://www.mindstick.com/articles/12694/how-dolomite-mineral-is-useful-in-human-life) advantage is it can be used in [code blocks](https://www.mindstick.com/forum/34555/code-blocks). It is called the “Dispose()” [method](https://www.mindstick.com/forum/166/webservice-method) automatically to [release](https://www.mindstick.com/news/2247/apple-plans-to-release-new-macs-in-early-2023) the [resources](https://yourviews.mindstick.com/view/293/renovation-causes-wastage-of-resources) and also automatically implements the try catch blocks for you. Here it is called a using statement. So the advantage is that we don’t have to explicitly write a try-[catch block](https://www.mindstick.com/forum/159348/how-does-an-exception-find-the-correct-catch-block) and our code looks small.

##### Syntax:

```
using (){}
```

\

Example: Defines a scope, outside of which an object or [objects](https://www.mindstick.com/forum/145447/what-are-objects) will be disposed.

The object can be declared in the using statement, as shown above, or before the using statement as below

```
Font font = new Font("Times New Roman", 12.0f);using (font){    // use font}
```

---

Original Source: https://www.mindstick.com/blog/431/use-of-using-keyword-in-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
