Sunday, March 25, 2018
Saturday, March 24, 2018
Readonly and Constant in C#
Constant: Constant fields are define at the time of declaration and once they are defined can't be changed.
NOTE:
- This can't be declared static.
- Local scope
- This is implicitly static variable.
- This must to initialised
Thursday, March 22, 2018
Dictionary in C#
- Dictionary is generic collection and includes System.Collections.Generic namespace.
- This is collection of Key and value pair and key must be a unique.
- In the dictionary, you cannot be including duplicate key.
- In the dictionary, duplicate key given run time error.
NOTE:
- It returns
error if we try to find a key which does not exist.
- It is faster than a hash table because there is no boxing and unboxing.
- Dictionary is a generic type which means we can use it with any data type.
List<T> in C#
List
- Lists are strongly typed generic collections.
- They will store values of different or same datatype.
- List size will increase or decrease dynamically.
- Its defined in the System.Collections.Generic namespace
Add item in List :
Subscribe to:
Posts (Atom)
Hash Table in C#
The Hashtable is a non-generic collection and used to store the key/value pairs based on the hash code of the key. Key will be used to acce...
-
Html.TextBoxFor in MVC 2 doesn't allow the setting of the value property using the object html attributes. syntax - <%= Html.Text...
-
Dictionary<string, string> DicSearch; DicSearch = new Dictionary<string, string>(); DicSearch.Add("1", "Mohi...
-
e.preventDefault() is the key method, to disable the default operations to proceed further. We first stop the event from further bubbli...
-
****************** Type 1 ********************* System.Nullable<DateTime> dt; dt = null; ****************** Type 2 **************...