AmitDiwan has Published 10744 Articles

DateTime.GetTypeCode() Method in C#

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 10:38:15

77 Views

he DateTime.GetTypeCode() method in C# is used to return the TypeCode for value type DateTime. The returned value is the enumerated constant, DateTime.SyntaxFollowing is the syntax −public TypeCode GetTypeCode ();ExampleLet us now see an example to implement the DateTime.GetTypeCode() method −using System; public class Demo {    public static void ... Read More

Get current year in MySQL WHERE clause?

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 10:37:28

781 Views

To get current year, use YEAR() along with CURDATE(). Let us first create a table −mysql> create table DemoTable1360     -> (     -> JoiningYear int     -> )     -> ; Query OK, 0 rows affected (0.51 sec)Insert some records in the table using insert ... Read More

DateTime.GetHashCode() Method in C#

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 10:36:23

643 Views

The DateTime.GetHashCode() method in C# is used to returns the hash code for this instance. This return value is a 32-bit signed integer hash code.SyntaxFollowing is the syntax −public override int GetHashCode ();ExampleLet us now see an example to implement the DateTime.GetHashCode() method −using System; public class Demo {   ... Read More

Using backticks in CONTACT() gives an error in MySQL

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 10:35:10

149 Views

Do not use backticks, you can use single quotes in CONCAT(). Following is the syntax −select concat(yourColumnName1, ' ', yourColumnName2) from yourTableName;Let us first create a table −mysql> create table DemoTable1359     -> (     -> Id int,     -> Name varchar(20)     -> ); Query ... Read More

DateTime.GetDateTimeFormats() Method in C#

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 10:34:11

1K+ Views

The DateTime.GetDateTimeFormats() method in C# is used to convert the value of this instance to all the string representations supported by the standard date and time format specifiers.SyntaxFollowing is the syntax −public string[] GetDateTimeFormats () public string[] GetDateTimeFormats (char ch);Above, ch is a standard date and time format string.ExampleLet us ... Read More

DateTime.FromOADate() Method in C#

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 07:18:25

678 Views

The DateTime.FromOADate() method in C# is used to return a DateTime equivalent to the specified OLE Automation Date.SyntaxFollowing is the syntax −public static DateTime FromOADate (double val);Above, Val is the OLE Automation Date value.ExampleLet us now see an example to implement the DateTime.FromOADate() method −using System; public class Demo { ... Read More

UInt32 Struct in C#

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 07:16:41

873 Views

The UInt32 struct represents a 32-bit unsigned integer. The UInt32 value type represents unsigned integers with values ranging from 0 to 4, 294, 967, 295.Let us now see some examples of UInt32 Struct methods −UInt32.CompareTo()The UInt32.CompareTo() method in C# is used to compare the current instance to a specified object ... Read More

UInt16 Struct in C#

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 07:13:52

534 Views

The UInt16 struct represents a 16-bit unsigned integer. The UInt16 value type represents unsigned integers with values ranging from 0 to 65535.Let us now see some examples of UInt16 Struct methods −UInt16.CompareTo()The UInt16.CompareTo() method in C# is used to compare the current instance to a specified object or UInt16 and ... Read More

Math Class in C#

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 07:10:02

1K+ Views

The Match class has static methods and constants for trigonometric, logarithmic and other mathematical functions.The Math class in C# has Math.E and Math.PI fields. Let us see an example of both the fields −Math.EIt is the natural logarithmic base specified by the constant e.SyntaxThe syntax is as follows −public const ... Read More

Uri.GetHashCode() Method in C#

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 07:07:29

68 Views

The Uri.GetHashCode() method in C# gets the hash code for the URI.SyntaxFollowing is the syntax −public override int GetHashCode ();ExampleLet us now see an example to implement the Uri.GetHashCode() method −using System; public class Demo {    public static void Main(){       string URI1 = "https://www.tutorialspoint.com/index.htm";     ... Read More

Advertisements