Question: I am new to Visual Studio and C# in general. I'm following a tutorial trying to learn the language ([tutorial here](http://weblogs.asp.net/scottgu/archive/2011/05/05/ef-code-first-and-data-scaffolding-with-the-asp-net-mvc-3-tools-update.aspx)). 

One of the steps is to **add a “using” statement to the System.Data.Entity namespace at the top of the class file (in order to reference the DbContext and DbSet classes)**. This can be found under step 3.

I'm hoping someone can help me out with this section. I've searched on here and Google for an answer, but since I'm new to the language I can't seem to find the correct answer. Any help would be greatly appreciated!

Answer: 
Although your question is about the `using` **statement**, I believe you mean the `using` **directive**.

### Using Directive

To allow the use of types in a namespace so that you do not have to qualify the use of a type in that namespace:

```
using System.Data.Entity;

namespace MyNamespace
{
    // Your code
}

```

Using directives are typically placed at the top of your file, but they can be placed at the top of your namespace as well.

```
namespace MyNamespace
{
    using System.Data.Entity;

    // Your code
}

```

*For more information on using directives, see*: [using Directive (C# Reference)](http://msdn.microsoft.com/en-us/library/sf0df423.aspx)

A note about references: Before you can use `System.Data.Entity`, you'll need to add a reference to the EntityFramework.dll. [NuGet](http://nuget.org/packages/EntityFramework/5.0.0) is a great tool for this, and can be invoked using the [Visual Studio Package Manager](http://docs.nuget.org/docs/start-here/using-the-package-manager-console).

### Using Alias Directive

To create an alias for a namespace or a type. This is called a using alias directive:

```
using Project = PC.MyCompany.Project;

```

*For more information on using alias directives, see*: [using Directive (C# Reference)](http://msdn.microsoft.com/en-us/library/sf0df423.aspx)

### Using Statement

Provides a convenient syntax that ensures the correct use of IDisposable objects:

```
using (var font1 = new Font("Arial", 10.0f)) 
{
    byte charset = font1.GdiCharSet;
}

```

*For more information on using statements, see*: [using Statement (C# Reference)](http://msdn.microsoft.com/en-us/library/yh598w02.aspx)
It is called [using directive](http://msdn.microsoft.com/en-us/library/sf0df423.aspx)

Every class, enum and other elements used in programming in C# are contained inside a namespace.  

To use these elements you need to refer to this namespace and this leads to a very long identifiers. The `using directive` instructs the compiler in which namespaces look for to find the definition of your elements.

You just need to add a line at the beginning of your class file stating the namespace that you intend to use in the remainder of your file.
For example, if you want to use a SqlConnection in your application, without the using directive you should write:

```
System.Data.SqlClient.SqlConnection con = new System.Data.SqlClient.SqlConnection(.....)

```

instead, adding 

```
using System.Data.SqlClient;

```

you could write simply

```
SqlConnection con = new SqlConnection(.....)

```