AmitDiwan has Published 10744 Articles

Get the sum only from specific cells in MySQL?

AmitDiwan

AmitDiwan

Updated on 11-Nov-2019 09:19:59

138 Views

For only specific cells, set a condition with WHERE and use aggregate function SUM() to add. Let us first create a table −mysql> create table DemoTable1370    -> (    -> StudentName varchar(20),    -> Marks int    -> ); Query OK, 0 rows affected (0.87 sec)Insert some records in ... Read More

DateTimeOffset.AddMonths() Method in C#

AmitDiwan

AmitDiwan

Updated on 11-Nov-2019 07:48:50

346 Views

The DateTimeOffset.AddMonths() method in C# is used to add a specified number of months to the value of this instance.SyntaxFollowing is the syntax −public DateTimeOffset AddMonths (int val);Above, Val is the number of months to be added. For subtracting months, set a negative value.ExampleLet us now see an example to ... Read More

DateTimeOffset.AddMinutes() Method in C#

AmitDiwan

AmitDiwan

Updated on 11-Nov-2019 07:47:39

406 Views

The DateTimeOffset.AddMinutes() method in C# is used to adds a specified number of whole and fractional minutes to the value of this instance.SyntaxFollowing is the syntax −public DateTimeOffset AddMinutes (double val);Above, Val is the number of minutes to be added. To subtract, set a negative value for minutes.ExampleLet us now ... Read More

Byte.Equals(Byte) Method in C#

AmitDiwan

AmitDiwan

Updated on 11-Nov-2019 07:45:44

322 Views

The Byte.Equals(Byte) method in C# returns a value indicating whether this instance and a specified Byte object represent the same value.SyntaxFollowing is the syntax −public bool Equals (byte ob);Above, ob is an object to compare to this instance.ExampleLet us now see an example to implement the Byte.Equals(Byte) method −using System; ... Read More

Byte.CompareTo(Object) Method in C#

AmitDiwan

AmitDiwan

Updated on 11-Nov-2019 07:44:41

108 Views

The Byte.CompareTo(Object) method in C# is used to compare this instance to a specified object and returns an indication of their relative values.SyntaxFollowing is the syntax −public int CompareTo (object val);Above, Val is an object to compare or null.The return value is less than zero if the current instance is ... Read More

Byte.CompareTo(Byte) Method in C#

AmitDiwan

AmitDiwan

Updated on 11-Nov-2019 07:43:25

146 Views

The Byte.CompareTo(Byte) method in C# is used to compare this instance to a specified 8-bit unsigned integer and returns an indication of their relative values.SyntaxFollowing is the syntax −public int CompareTo (byte val);Above, the parameter value is an 8-bit unsigned integer to compare.The return value is less than zero if ... Read More

Boolean.TryParse() Method in C#

AmitDiwan

AmitDiwan

Updated on 11-Nov-2019 07:41:53

2K+ Views

The Boolean.TryParse() method in C# is used to convert the specified string representation of a logical value to its Boolean equivalent.SyntaxFollowing is the syntax −public static bool TryParse (string val out bool result);ExampleLet us now see an example to implement the Boolean.TryParse() method −using System; public class Demo {   ... Read More

DateTime.ToUniversalTime() Method in C#

AmitDiwan

AmitDiwan

Updated on 11-Nov-2019 07:40:39

992 Views

The DateTime.ToUniversalTime() method in C# is used to convert the value of the current DateTime object to Coordinated Universal Time (UTC).SyntaxFollowing is the syntax −public DateTime ToUniversalTime ();ExampleLet us now see an example to implement the DateTime.ToUniversalTime() method −using System; public class Demo {    public static void Main() { ... Read More

DateTime.ToString() Method in C#

AmitDiwan

AmitDiwan

Updated on 11-Nov-2019 07:39:23

432 Views

The DateTime.ToString() method in C# is used to convert the value of the current DateTime object to its equivalent string representation.SyntaxFollowing is the syntax −ToString(String, IFormatProvider) ToString() ToString(IFormatProvider) ToString(String)ExampleLet us now see an example to implement the DateTime.ToString() method −using System; public class Demo {    public static void Main() ... Read More

DateTime.ToShortTimeString() Method in C#

AmitDiwan

AmitDiwan

Updated on 11-Nov-2019 07:38:13

1K+ Views

The DateTime.ToShortTimeString() method in C# is used to convert the value of the current DateTime object to its equivalent short time string representation.SyntaxFollowing is the syntax −public string ToShortTimeString ();ExampleLet us now see an example to implement the DateTime.ToShortTimeString() method −using System; using System.Globalization; public class Demo {    public ... Read More

Advertisements