Chandu yadav has Published 1163 Articles

What are the hidden features of C#?

Chandu yadav

Chandu yadav

Updated on 21-Jun-2020 12:06:09

285 Views

The following are the hidden or lesser known useful features of C# −Lambda ExpressionsA lambda expression in C# describes a pattern. It has the token => in an expression context. This is called goes to operator and used when a lambda expression is declared.NullablesC# provides a special data types, the ... Read More

Set the color of the four borders using CSS

Chandu yadav

Chandu yadav

Updated on 21-Jun-2020 10:23:16

82 Views

To set the color of the four borders, use the border-color property. You can try to run the following code to set border color for all the bordersExampleLive Demo                    p {             border-style: dashed;             border-color: #808000 #800000 #FF0000 #FFFF00;          }                     This is demo text with four colored border.     Output

Style elements with a value within a specified range with CSS

Chandu yadav

Chandu yadav

Updated on 21-Jun-2020 08:40:26

87 Views

To style elements with a value within a specified range, use the CSS :in-range selector. You can try to run the following code to implement the :in-range selectorExampleLive Demo                    input:in-range {             border: 3px dashed orange;             background: yellow;          }                           The style only works for the value entered i.e. 9    

What are increment (++) and decrement (--) operators in C#?

Chandu yadav

Chandu yadav

Updated on 20-Jun-2020 17:31:20

410 Views

Increment OperatorsTo increment a value in C#, you can use the increment operators i.e. Pre-Increment and Post-Increment Operators.The following is an example −Exampleusing System; class Demo {    static void Main() {       int a = 250;       Console.WriteLine(a);       a++;   ... Read More

What is the C# Equivalent of SQL Server DataTypes?

Chandu yadav

Chandu yadav

Updated on 20-Jun-2020 17:18:20

13K+ Views

The following table displays the C# equivalent of SQL Server datatypes −SQL Server data typeEquivalent C# data typevarbinaryByte[]binaryByte[]imageNonevarcharNonecharNonenvarcharString, Char[]ncharString, Char[]textNonentextNonerowversionByte[]bitBooleantinyintBytesmallintInt16intInt32bigintInt64smallmoneyDecimalmoneyDecimalnumericDecimaldecimalDecimalrealSinglefloatDoublesmalldatetimeDateTimedatetimeDateTimetableNonecursorNonetimestampNonexmlNone

What is the AddRange method in C# lists?

Chandu yadav

Chandu yadav

Updated on 20-Jun-2020 17:13:12

6K+ Views

AddRange method in lists adds an entire collection of elements. Let us see an example −Firstly, set a list in C# and add elements −List list = new List(); list.Add(100); list.Add(200); list.Add(300); list.Add(400);Now set an array of elements to be added to the list −// array of 4 elements int[] ... Read More

What are reference data types in C#?

Chandu yadav

Chandu yadav

Updated on 20-Jun-2020 17:06:41

1K+ Views

The reference data type in C# does not have the actual data stored in a variable, but they contain a reference to the variables.In C#, the following are the built-in reference types −Object TypeThe Object Type is the ultimate base class for all data types in C# Common Type System ... Read More

What are mixed arrays in C#?

Chandu yadav

Chandu yadav

Updated on 20-Jun-2020 17:02:28

747 Views

Mixed arrays are a combination of multi-dimension arrays and jagged arrays.Note − The mixed arrays type is obsolete now since .NET 4.0 update removed it.Let us see how you can declare a mixed array −var x = new object[] {89, 45, "jacob", 9.8}We can also set them as −var x ... Read More

Hashtable vs. Dictionary in C#

Chandu yadav

Chandu yadav

Updated on 20-Jun-2020 16:47:09

939 Views

HashtableA hash table is used when you need to access elements by using key, and you can identify a useful key value. Each item in the hash table has a key/value pair. The key is used to access the items in the collection.The members in a Hashtable are thread safe. ... Read More

Ways to print escape characters in C#

Chandu yadav

Chandu yadav

Updated on 20-Jun-2020 16:46:28

727 Views

The following are the escape characters in C# and the display column suggests how to use and print them in C# −Escape CharacterDescriptionPatternDisplay\aMatches a bell character, \u0007.\a"\u0007" in "Warning!" + '\u0007'\bIn a character class, matches a backspace, \u0008.[\b]{3, }"\b\b\b\b" in "\b\b\b\b"\tMatches a tab, \u0009.(\w+)\t"Name\t", "Addr\t" in "Name\tAddr\t"\rMatches a carriage return, ... Read More

Advertisements