AmitDiwan has Published 11365 Articles

Boolean.CompareTo(Boolean) Method in C#

AmitDiwan

AmitDiwan

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

524 Views

The Boolean.CompareTo(Boolean) method in C# is used to compare this instance to a specified Boolean object and returns an integer that indicates their relationship to one another.SyntaxFollowing is the syntax −public int CompareTo (bool val);Above, Val is a Boolean object to compare to the current instance.ExampleLet us now see an ... Read More

How to find all tables that contains two specific columns in MySQL?

AmitDiwan

AmitDiwan

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

584 Views

To find two specific column names, use information_schema.columns Here, I am using Id in place of columnA and Name in place of columnB −mysql> select table_name as TableNameFromWebDatabase    -> from information_schema.columns    -> where column_name IN ('Id', 'Name')    -> group by table_name    -> having count(*) = 3;This ... Read More

BitConverter.ToBoolean() Method in C#

AmitDiwan

AmitDiwan

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

60 Views

The BitConverter.ToBoolean() method in C# returns a Boolean value converted from the byte at a specified position in a byte array.SyntaxFollowing is the syntax −public static bool ToBoolean (byte[] arr, int startIndex);Above, arr is a byte array, whereas startIndex is the index of the byte within a value.ExampleLet us now ... Read More

DateTime.IsLeapYear() Method in C#

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 10:42:32

3K+ Views

The DateTime.IsLeapYear() method in C# is used to check whether the specified year is a leap year. The return value is a boolean, with TRUE if the year is a leap year, else FALSE.SyntaxFollowing is the syntax −public static bool IsLeapYear (int y);Above, y is the year to be checked, ... Read More

DateTime.IsDaylightSavingTime() Method in C#

AmitDiwan

AmitDiwan

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

282 Views

The DateTime.IsDaylightSavingTime() method in C# is used to indicate whether this instance of DateTime is within the daylight saving time range for the current time zone.SyntaxFollowing is the syntax −public bool IsDaylightSavingTime ();ExampleLet us now see an example to implement the DateTime.IsDaylightSavingTime() method −using System; public class Demo {   ... Read More

Delete URLs with specific domains from MySQL database?

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 10:39:25

222 Views

To delete URLs with specific domains, use DELETE and LIKE clause.Let us first create a table −mysql> create table DemoTable1361     -> (     -> URL text     -> ) ; Query OK, 0 rows affected (0.58 sec)Insert some records in the table using insert command −mysql> ... Read More

DateTime.GetTypeCode() Method in C#

AmitDiwan

AmitDiwan

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

51 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

600 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

530 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

86 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

Advertisements