Skip to main content

Namespace In .NET

Hi friends ! many times i have seen that student do not include Namespace in our program , so that program gives error.Then student are faced more problems to Run the program. Before including Namespace ,you should knowwhat is Namespace and why include it in our program.If you want to make a good programmer in c# then you should know more well about Namespace.Please read every things about Namespace which is give below:
What is Namespace in C#?.
A Namespace is collection of classes with related type contained in a assembly file.
Ex.
 System.IO Namespace is used for I/O related type Files and Buffering.

There are two basic region for  using Namespace.
  1. To make the logical group of classes.
  2. To avoid the name confliction of classes(means more than class with same program but different Namespace).
Now i am going to explain some Namespaces which is more need in our programs.Here i have removed Usingkeyword in all Namespaces. please include it before every Namespace.
  1. System -> This Namespace  is used for following attribute in our program.
  • Mathematical computations.
  • Random Number generation
  • Garbage collection
  • Intrinsic data
  • Exceptions and attributes
    2. System.Data ->This Namespace is used when we are using Database connectivity in Ado.NET Application. If any Namespace  use "Dataattribute then it will used for Database connectivity in .NET.

     3. System.Data.sqlClient -> This also used for database connectivity in Ado.NET When we are use sql query for data connection.

     4. System.Collections -> This Namespace is used when we are using collections (Generic and Non Generic).

     5. System.Collections.Generic -> This Namespace is used for Generic collection(Ex. ArryList,stack,Dictionary,queue);
  
     6. System.Drawing -> This Namespace is used for Graphical Primitive data type such as size,fonts andprinting services etc.

     7. System.Reflection -> This Namespace is used Run type discovery and dynamic creation of types.
   
     8. System.Security -> This Namespace is used for Security Purpose.Suppose if we are using Cryptography security in .NET Application then we will use this Namespace in our .NET Application.
     
     9. System.Threading -> This Application is used when we are making a multithreading application in .Net .

     10. System.web -> This Namespace is used when we are making a web Application in .NET. Ex. asp.net,XML web services etc.

     11. System.Windows.Forms -> When  we are making any GUI based application in .NET then we use this Namespace otherwise compiler gives error message.

     12. System.xml -> When we are using XML Language in our programs then we will use this Namespace in our programs.

      13. System.Configuration-> When  we configure some .net controls and use it in our .net application. then we use this Namespace.Ex. Configuration of Sql Data Source or Sql Data Adapter and use it for connection.

Comments

Popular posts from this blog

Structure  is a user defined type which can contain different member ( variable , method and  property  etc).  Class  is  a user define type which can contain such type of member but there is some difference between structure and class. Now i am going to implement  structure and class in C#  after that i will show you exact difference between structure and class in  C# . There are some steps please follow them step by step which is given below. Step  1  First open your visual studio->File->New->project->console Application->OK->Now write the following code which is giv en below in  step 2. Step  2  structure   and class program code:- see it:- 01 using   System; 02 namespace   structure 03 { 04      class   Program 05      { 06          public   struct  ...

what is dll in c#.net

Stands for "Dynamic Link Library." A DLL (.dll) file contains a library of functions and other information that can be accessed by a Windows program. When a program is launched, links to the necessary .dll files are created. If a static link is created, the .dll files will be in use as long as the program is active. If a dynamic link is created, the .dll files will only be used when needed. Dynamic links help programs use resources, such as memory and hard drive space, more efficiently. DLL files can also be used by more than one program. In fact, they can even be used by multiple programs at the same time. Some DLLs come with the Windows operating system while others are added when new programs are installed. You typically don't want to open a .dll file directly, since the program that uses it will automatically load it if needed. Though DLL filenames usally end in ".dll," they can also end in .exe, .drv, and .fon, just to make thing...