Saturday, 7 January 2012

C# Collections

Arrays:
Arrays are reference types created on the heap.
Multidimensional Arrays:
C# supports two kinds of multidimensional arrays.They are Rectangular array and Jagged array.
In a rectangular array, every row is of same length.In jagged array rows can be of different length.
Arraylist:
Arraylist solves the issue of arrays where we have to specify the array to a fixed size.Arraylist is a dynamic array.We can use Add( ) method to insert values in array dynamically. 
Dictionary:
Dictionary class uses key value pairs to add and retrieve data. An example for dictionary is Hashtable. Here with the help of keys, we can access the specific values.
ICollection Interface:
To retrieve values from collections.
eg: ICollection key = hashtable.Keys;
     ICollection Val = hashtable.Values; // where hashtable is Hashtable object.

T-Sql ROW_NUMBER:
Returns the sequential number of a row within a partition of a result set, starting at 1 for the first row in each partition. This row number can be used to eliminate duplicate rows using CTE.


No comments:

Post a Comment