Web Studyaspnet.blogspot.com Babyneed.blogspot.com

ASP.Net Web Developer Guide

Power By: eXTReMe Tracker Powered by Blogger  
 
 
 
 

 

 
Important Links
 
   
     
 
Sitemap
 
   
   
 
Reference
 
   

Friday, February 10, 2006

Colletion of Namespaces in ASP.NET(Chapter 2)

Table 2.2 The Namespace Collection
Namespaces --Description
CodeDom -- Contains objects that represent the elements of a source code document.
Collections -- Contains collection objects, such as lists, queues, and hash tables.
ComponentModel -- Contains the classes that enable you to control the run and design-time behavior of components and controls.
Configuration -- Provides methods and objects that enable you to access .NET configuration settings.
Data -- Contains classes that enable you to interact with data sources; constitutes ADO.NET.
Diagnostics -- Contains classes that enable you to debug and follow the execution of your applications.
DirectoryServices -- Provides access to Active Directory services.Drawing Contains classes that enable you to use basic, graphical display interface (GDI) capabilities.
EnterpriseServices -- Contains objects that enable you to control how components behave on a server.
Globalization -- Contains classes that define culture-related information.
IO -- Contains classes that enable you to read and write to data streams and files.
Management -- Provides classes used to interface with WMI events and objects.
Messaging -- Contains classes to interact with messages over a network.
Net -- Provides classes to work with network protocols.
Reflection -- Contains classes that enable you to view information about other types in the .NET Framework.
Resources -- Contains classes that enable you to manage culturespecific resources.
Security -- Provides access to the .NET security framework.
ServiceProcess -- Enables you to interact with services.
Text -- Contains classes that represent ASCII, Unicode, UTF-7, and UTF-8 character encodings.
Threading -- Contains classes that enable multi-threaded programming.
Timers -- Contains classes to raise events on specified time intervals.
Web -- Provides client/browser communications; represent the
bulk -- of objects that will be used with ASP.NET.
Xml -- Contains classes that process XML data.
Grouping Objects and Data Types with
the System.Collections Namespace
The System.Collections namespace contains much of the functionality you’ll need for grouping objects and data types into collections.These include lists, arrays, hash tables, and dictionaries, as well as some collections that you won’t see as often in ASP.NET: stacks, comparers, and queues.
Supplied Functionality
The classes in the System.Collections namespace are often very useful, but unfortunately are often not in the spotlight in ASP.NET.They each have specific uses that just may come in handy for your applications.They are listed in Table 2.3.
Table 2.3 The System.Collections Classes
Name -- Description
ArrayList -- Creates an array whose size is dynamically increased as necessary.
BitArray -- Provides an array of bits (Boolean values).
CaseInsensitiveComparer -- Provides case-insensitive comparison of two objects.
CaseInsensitiveHashCodeProvider -- Creates hash codes for objects, ignoring cases for strings.
CollectionBase -- The base class for a strongly typed collection. This class must be inherited from—it cannot be directly instantiated.
Comparer -- A case-sensitive object comparison class.
DictionaryBase -- The base class for a strongly typed collection of key/value pairs. This class must also be inherited from.
Hashtable -- A collection of key/value pairs organized by the hash value of the key.
Queue -- A first-in, first-out collection of objects.
ReadOnlyCollectionBase -- Just like the CollectionBase class, but the values are read-only.
SortedList -- A collection of key/value pairs sorted by the key value.
Stack -- A last-in, first-out collection of objects.
In addition to the classes outlined in Table 2.3, there is the System.Array class, which holds collections of values. Let’s take a look at an example.The following code creates an array of integers, initialized to the numbers 1 to 5:
Dim arrIntegers() As Integer = {1, 2, 3, 4, 5}
The size of this array is 5, and the index values are 0 to 4. For example, to access the number 3 in this array, you would use this:
arrIntegers(2)
Note that you cannot declare a size for an array and assign values at the same time.The following code would produce an error:
Dim arrIntegers(5) As Integer = {1, 2, 3, 4, 5}
Instead, separate the declaration and assignation into two steps:
Dim arrIntegers(5)
arrIntegers(0) = 1
arrIntegers(1) = 2
'and so on
The Array class has quite a few useful methods and properties as well, such as the Copy and Sort methods, and the Length and Rank properties.You’ll examine these more as you progress through the book.

0 Comments:

Post a Comment

<< Home