AmitDiwan has Published 10744 Articles

Decimal.Divide() Method in C#

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 09:44:06

1K+ Views

The Decimal.Divide() method in C# is used to divide two specified Decimal values.SyntaxFollowing is the syntax −public static decimal Divide (decimal val1, decimal val2);Above, val1 is the dividend, whereas val2 is the divisor.ExampleLet us now see an example to implement the Decimal.Divide() method −using System; public class Demo {   ... Read More

Decimal.CompareTo() Method in C#

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 09:38:24

139 Views

The Decimal.CompareTo() method in C# is used to compare this instance to a specified object or Decimal and returns an indication of their relative values.SyntaxFollowing is the syntax −public int CompareTo (decimal value); public int CompareTo (object value);ExampleLet us now see an example to implement the Decimal.CompareTo() method −using System; ... Read More

Convert.ToDecimal(String, IFormatProvider) Method in C#

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 09:35:32

1K+ Views

The Convert.ToDecimal() method in C# converts the specified string representation of a number to an equivalent decimal number, using the specified culture-specific formatting information.SyntaxFollowing is the syntax −public static decimal ToDecimal (string val, IFormatProvider provider);Above, Val is a string that contains a number to convert, whereas the provider is an ... Read More

Cast one of the values in MySQL and perform division with the other?

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 09:35:06

169 Views

For this, at first, use CAST(). Let us first create a table −mysql> create table DemoTable1352     -> (     -> Value1 int,     -> Value2 int     -> ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command−mysql> insert ... Read More

Convert.ToDateTime(String, IFormatProvider) Method in C#

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 09:34:04

4K+ Views

The Convert.ToDateTime() method in C# converts the specified string representation of a number to an equivalent date and time, using the specified culture-specific formatting information.SyntaxFollowing is the syntax −public static DateTime ToDateTime (string val, IFormatProvider provider);Above, value is a string that contains a date and time to convert, whereas the ... Read More

Display only the duplicate column names appearing atleast thrice in MySQL

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 09:33:43

103 Views

Use HAVING COUNT() for this. Let us first create a table −mysql> create table DemoTable1351     -> (     -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,     -> StudentName varchar(40)     -> ); Query OK, 0 rows affected (1.08 sec)Insert some records in the table ... Read More

Convert.ToChar(String, IFormatProvider) Method in C#

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 09:32:36

959 Views

The Convert.ToChar() method in C# is used to convert the first character of a specified string to a Unicode character, using specified culture-specific formatting information.SyntaxFollowing is the syntax −public static char ToChar (string val, IFormatProvider provider);Above, the parameter value is a string of length 1 or null and the parameter ... Read More

DateTime.ToLongTimeString() Method in C#

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 09:30:43

1K+ Views

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

Avoiding rewrite attributes with MySQL AUTO_INCREMENT

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 09:29:46

114 Views

You can avoid with the help of providing the value (NULL, 0, DEFAULT) with AUTO_INCREMENT. Let us first create a table −mysql> create table DemoTable1350    -> (    -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> StudentName varchar(20)    -> ); Query OK, 0 rows affected (0.44 ... Read More

DateTime.ToLongDateString() Method in C#

AmitDiwan

AmitDiwan

Updated on 05-Nov-2019 09:28:51

4K+ Views

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

Advertisements