Wednesday, September 01, 2004

.NET namespaces

Namespaces are treated as containers for all classes. Namespaces are

classified into several categories, based on the functionality of

their classes. For example, if you need to work with databases, you

have to call the System.Data namespace. Similarly, if you work with

files, you have to call the System.IO namespace.



Namespaces in C# are similar to packages in Java, where we use a

statement such as java.sql.*. Moreover, all C# programs should call

the System namespace. This is the root of all other namespaces in the

.NET Framework.



You have to apply the namespaces by following certain conventions as

laid out by the .NET Framework. All namespaces should be called in

your programs by applying the using keyword.



A list of important .NET namespaces is shown in the following table:



System.Collections

System.IO

System.Data

System.Net

System.Data.OleDb

System.Reflection

Stsrem.Data.SqlClient

System.Runtime.InteropServices

System.Data.OracleClient

System.Runtime.Remoting

System.Diagnostics

System.Security

System.Drawing

System.Threading

System.Drawing.Drawing2D

System.Web

System.Drawing.Printing

System.Xml

System.Windows.Forms

No comments: