DateTime ToOADate Method in C#

AmitDiwan
Updated on 08-Nov-2019 11:07:08

770 Views

The DateTime.ToOADate() method in C# is used to convert the value of this instance to the equivalent OLE Automation date.SyntaxFollowing is the syntax −public double ToOADate ();ExampleLet us now see an example to implement the DateTime.ToOADate() method −using System; public class Demo {    public static void Main() {       DateTime d = new DateTime(2019, 10, 11, 9, 10, 35);       Console.WriteLine("Date = {0}", d);       double res = d.ToOADate();       Console.WriteLine("OLE Automation date = {0}", res);    } }OutputThis will produce the following output −Date = 10/11/2019 9:10:35 AM OLE Automation ... Read More

Create a Stored Procedure with MySQL and Set a Limit

AmitDiwan
Updated on 08-Nov-2019 11:06:45

735 Views

Let us first create a table −mysql> create table DemoTable1368     -> (     -> ClientId int,     -> ClientName varchar(20)     -> ); Query OK, 0 rows affected (0.58 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1368 values(101, 'Adam'); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable1368 values(102, 'Bob'); Query OK, 1 row affected (0.10 sec) mysql> insert into DemoTable1368 values(103, 'John'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable1368 values(104, 'Sam'); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable1368 values(105, ... Read More

Select None of the Rows and Columns in MySQL

AmitDiwan
Updated on 08-Nov-2019 11:05:25

793 Views

To display none of the rows and columns, use SELECT NULL and FALSE as in the below syntax −select null from yourTableName where false;Let us first create a table −mysql> create table DemoTable1367     -> (     -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,     -> FirstName varchar(20)     -> ); Query OK, 0 rows affected (0.55 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1367(FirstName) values('Chris'); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable1367(FirstName) values('David'); Query OK, 1 row affected (0.10 sec) mysql> insert into DemoTable1367(FirstName) values('Bob'); ... Read More

char CompareTo Method in C#

AmitDiwan
Updated on 08-Nov-2019 11:05:10

4K+ Views

The Char.CompareTo() method in C# is used to compare this instance to a specified object or value type, and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified object or value type.SyntaxFollowing is the syntax −public int CompareTo (char val); public int CompareTo (object val);Above, Val for the 1st syntax is a char object to compare, whereas for the 2nd syntax it is an object to compare this instance to or null.The return value is zero if the current instance has the same position in the sort order as Val. ... Read More

Byte ToString Method in C#

AmitDiwan
Updated on 08-Nov-2019 11:03:29

75 Views

The Byte.ToString() method in C# converts the value of the current Byte object to its equivalent string representation.SyntaxFollowing is the syntax −public override string ToString ();ExampleLet us now see an example to implement the Byte.ToString() method −using System; public class Demo {    public static void Main(){       byte val1, val2;       val1 = Byte.MinValue;       val2 = 15;       Console.WriteLine("Value1 (Byte) = "+val1.ToString());       Console.WriteLine("Value2 (Byte) = "+val2.ToString());    } }OutputThis will produce the following output −Value1 (Byte) = 0 Value2 (Byte) = 15

Byte MinValue Field in C#

AmitDiwan
Updated on 08-Nov-2019 11:02:02

99 Views

The Byte.MinValue field in C# is used to represent the smallest possible value of a Byte.SyntaxFollowing is the syntax −public const byte MinValue = 0;ExampleLet us now see an example to implement the Byte.MinValue method −using System; public class Demo {    public static void Main(){       byte val;       val = Byte.MinValue;       Console.WriteLine("Minimum Value (Byte) = "+val);    } }OutputThis will produce the following output −Minimum Value (Byte) = 0

Ignore Specific Character in MySQL Query Results

AmitDiwan
Updated on 08-Nov-2019 11:02:00

396 Views

To ignore a specific character, use NOT LIKE operator. Let us first create a table −mysql>  create table DemoTable1366     -> (     -> CountryName varchar(20)     -> ); Query OK, 0 rows affected (0.77 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1366 values('AUS'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable1366 values('UK'); Query OK, 1 row affected (0.11 sec) mysql> insert into DemoTable1366 values('US'); Query OK, 1 row affected (0.10 sec)Display all records from the table using select statement −mysql> select * from DemoTable1366; This will produce the ... Read More

Byte MaxValue Field in C#

AmitDiwan
Updated on 08-Nov-2019 11:00:30

232 Views

The Byte.MaxValue field in C# is used to represent the largest possible value of a Byte.SyntaxFollowing is the syntax −public const byte MaxValue = 255;ExampleLet us now see an example to implement the Byte.MaxValue field −using System; public class Demo {    public static void Main(){       byte val;       val = Byte.MaxValue;       Console.WriteLine("Maximum Value (Byte) = "+val);    } }OutputThis will produce the following output −Maximum Value (Byte) = 255

Byte GetTypeCode Method in C#

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

76 Views

The Byte.GetTypeCode() method in C# returns the TypeCode for value type Byte.SyntaxFollowing is the syntax −public TypeCode GetTypeCode ();ExampleLet us now see an example to implement the Byte.GetTypeCode() method −using System; public class Demo {    public static void Main(){       byte val1;       val1 = 50;       TypeCode type = val1.GetTypeCode();       Console.WriteLine("TypeCode = "+type);    } }OutputThis will produce the following output −TypeCode = Byte

Cosh Method in C#

AmitDiwan
Updated on 08-Nov-2019 10:58:09

82 Views

The Math.Cosh() method in C# is used to return the hyperbolic cosine of the angle specified as a parameter.SyntaxFollowing is the syntax −public static double Cosh (double val);Above, Val is an angle.ExampleLet us now see an example to implement Math.Cosh() method −using System; public class Demo {    public static void Main(){       double val1 = 30.0;       double val2 = 45.0;       Console.WriteLine(Math.Cosh(val1));       Console.WriteLine(Math.Cosh(val2));    } }OutputThis will produce the following output −5343237290762.23 1.74671355287425E+19ExampleLet us see another example to implement Math.Cosh() method −using System; public class Demo {    public ... Read More

Advertisements