Generics in asp net 2.0



Keywords: devasp.net, asp.net, asp.net help, vb.net, vs.net,, net framework, ado.net, asp, net, vb, net, xml, visual studio.net, soap, asp.net samples, vb.net samples, asp.net articles, vb.net articles, c-sharp, net, vb.net samples,, net framework, sample chapters, articles, samples, links, search, components
Description: This article will show you what are Generics and how can they benefit you in using collection more efficiently and securely. Generics are a new addition to the new .NET Framework. They are here

This article will show you what are Generics and how can they benefit you in using collection more efficiently and securely.

Generics are a new addition to the new .NET Framework. They are here to help you design and develop collections more securely and efficiently. In the previous releases of the .NET Framework you were given the System.Collections namespace that contained many classes for managing collection of objects. My most favorite ones were ArrayList and Hashtable. They allow you to store any thing in them and you can work with them by iterating over them of using the various functions provided in them for sorting, adding, removing and so on. In this new release, Microsoft has added a new namespace System.Collections.Generics that allows you to use a new type of collections. So why does a new kind of collections needed.

First of all you know when you are adding a new item in a collection that is based on System.Collections such as an ArrayList, if it is a Value Type object it needs to be boxed in to an object type. Boxing and Unboxing is a resourceful operation. Second is the measure for reliability. Lets say you are adding objects of type Person to an ArrayList and that ArrayList needs to be used by some other program that thinks that this ArrayList will contains only objects of Person. Now there is no simple way of restricting the ArrayList to add only objects of Person.

In a collection based on System.Collections.Generics you will always specify, before creation of the collection, the type of objects that this collection will contain. This will perform the reliability of the collection in that the program using this collection can be sure of that this is a collection of a specific type and there is no overhead of boxing and Unboxing using Generics.

In this above statement we are declaring a List of type Person. The new keyword Of is an addition in the Visual Basic language. The new syntax of iterating over a collection in Visual Basic is




Photogallery Generics in asp net 2.0:


Creating a generic Please Wait page for ASP.NET | N Rao ...


Dotnet difference questions and answers compiled- 1(updated-2)


Using a Custom HttpHandler to get data ASP.NET using Ajax and jQuery


Use ASP.NET's HttpHandler to bridge the cross-domain gap | Encosia


Asp.net 4


ASP.NET Guia de desarrollo de sitios y aplicaciones web dinamicas


Dotnetjalps-asp.net - Async file upload with jquery and ASP.NET


ASP.NET Guia de desarrollo de sitios y aplicaciones web dinamicas


narenderpatlollaresume-2-638. ...


Programming ASP.NET MVC 4.0


Migrating From ASP.NET Web API 2 to MVC 6  ASP.NET MVC 0.0.1 ...


C# ASP.NET EF Database first : The type was not mapped - Stack ...


La Papelera Informtica: Escribir Archivo XML desde ASP.NET


C# ASP.NET EF Database first : The type was not mapped - Stack ...


The Baker's Dozen: 13 Productivity Tips for Crystal Reports Redux


Microsoft ASP.NET 2.0 Member/Role Management with IISPart 2 ...


Asp[1].net 3.5 e book


Creating an Ajax enabled Contact Form in Umbraco 6 with ASP.NET ...