X hits on this document

PDF document

“Beginning Visual C# 2005 Express Edition Video Series” - page 59 / 73

143 views

0 shares

0 downloads

0 comments

59 / 73

Namespaces in the .NET Framework Class Library

The .NET Framework Class library has hundreds, if not thousands, of classes. In order to find the classes you are looking for, and as a result of good Object Oriented design, the classes are divided up into Namespaces. A namespace is a way of segregating classes into common functionality and also allows two classes with the same name to be unique. For example, I'm not the only Robert in Texas, but I'm one of only a couple of Robert Tabors in Texas. Furthermore, I'm the only Robert Theron Tabor in Texas, and probably the world, so by adding names that makes my otherwise common name unique. In a like manner, it would be very difficult for 3000+ classes to have different names, especially when some of them have similar functionality that is used at different times or for slightly different purposes.

There are dozens of important namespaces ... here are a few that you'll get to know over the next few video lessons:

System System.Data System.Data.SqlClient System.IO System.Exception System.Web

While the system Namespace is one of the most important, it’s not the only namespace root. If we wanted to create a connection to a database, we would have to write the following code:

Visual Basic:

Dim con As System.Data.SqlClient.SqlConnection

C#:

System.Data.SqlClient.SqlConnection con;

Supplemental Readings for the Express Edition Videos Copyright © 2005 LearnVisualStudio.NET



Document info
Document views143
Page views143
Page last viewedSat Oct 29 00:29:50 UTC 2016
Pages73
Paragraphs821
Words15988

Comments