AmitDiwan has Published 11365 Articles

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

AmitDiwan

AmitDiwan

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

762 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

121 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

3K+ 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

60 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

830 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

901 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

60 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

3K+ 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

Updating a MySQL table row column by appending a value from user defined variable?

AmitDiwan

AmitDiwan

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

253 Views

Let us first create a table −mysql> create table DemoTable1349    -> (    -> ProductId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> ProductPrice int    -> ); Query OK, 0 rows affected (0.71 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1349(ProductPrice) values(7644); Query ... Read More

DateTime.ToLocalTime() Method in C#

AmitDiwan

AmitDiwan

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

280 Views

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

Advertisements