Powered by Blogger.

Saturday, March 8, 2014

Namespace in C#.Net

In thid article we will discuss about namespace in C#.Net.

Also you can check out:

- Increase column size in sql server 2008

- Get stored procedure source text in sql server 2008

- Steps to create wcf service and host wcf service as windows service in C#.Net

- Namespace helps us in arranging code which is like a container. Namespaces can organize all the different types in the class library. Without namespaces, these types would all be grouped into a single long and messy list.

- Namespace can contain hundred of classes.

- Namespace can contain: classes, structures, interfaces, enumerations, delegates etc.

- Microsoft provides various namespaces like
System.IO etc.

- We can create a namespace by using namespace keyword like below:

namespace MyWebSites
public class AspDotNetHelp


We can use this namespace by using a using statement like below:

using MyWebSites;

After writing the above statement we will abe to access the AspDotNetHelp class.

Also you can directly access the class by writing like below:


- The extension of the namespaces will be .dll