AmitDiwan has Published 10744 Articles

Byte.Equals(Object) Method in C#

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 10:50:07

118 Views

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

Create variables in MySQL stored procedure with DECLARE keyword

AmitDiwan

AmitDiwan

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

692 Views

Use MySQL DECLARE for variables in stored procedure −DECLARE anyVariableName int DEFAULT anyValue;Let us implement the above syntax in order to create variables in stored procedure −mysql> DELIMITER // mysql> CREATE PROCEDURE variable_Demo()     -> BEGIN     -> DECLARE lastInsertedId int DEFAULT -1;     -> select lastInsertedId; ... Read More

Boolean.CompareTo(Object) Method in C#

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 10:48:27

113 Views

The Boolean.CompareTo(Object) method in C# compares this instance to a specified object and returns an integer that indicates their relationship to one another.SyntaxFollowing is the syntax −public int CompareTo (object ob);Above, the parameter ob is an object to compare to this instance, or null.ExampleLet us now see an example to ... Read More

Treat a MySQL column field as NULL if it is blank?

AmitDiwan

AmitDiwan

Updated on 08-Nov-2019 10:47:17

219 Views

Let us first create a table −mysql> create table DemoTable1362     -> (     -> ClientId int NOT NULL AUTO_INCREMENT PRIMARY KEY,     -> ClientName varchar(40)     -> ); Query OK, 0 rows affected (0.67 sec)Insert some records in the table using insert command −mysql> insert ... Read More

Boolean.CompareTo(Boolean) Method in C#

AmitDiwan

AmitDiwan

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

621 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

688 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

126 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

397 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

326 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

Advertisements