AmitDiwan has Published 10744 Articles

Check if Caps Lock and Num Lock is on or off through Console in C#

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 05:43:22

364 Views

To check if Caps Lock is on or off through Console, the code is as follows −Example Live Demousing System; public class Demo{    public static void Main(string[] args){       Console.WriteLine("The CAPS LOCK is on or not? "+ Console.CapsLock);    } }OutputThis will produce the following output −The CAPS ... Read More

How to use MySQL LIKE query to search a column value with % in it?

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 05:41:59

908 Views

To search a column value with %, the syntax is as follows −select * from yourTableName  where yourColumnName LIKE '\%%';Let us first create a table −mysql> create table DemoTable1497    -> (    -> Name varchar(20)    -> ); Query OK, 0 rows affected (0.55 sec)Insert some records in the ... Read More

MySQL query to group results by date and display the count of duplicate values?

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 05:40:38

564 Views

Let us first create a table −mysql> create table DemoTable1496    -> (    -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> PassengerCode varchar(20),    -> ArrivalDate datetime    -> ); Query OK, 0 rows affected (0.85 sec)Insert some records in the table using insert command −mysql> insert ... Read More

Get two days data (today and yesterday) from a MySQL table with timestamp values

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 05:38:29

318 Views

Let us first create a table −mysql> create table DemoTable1495    -> (    -> ShippingDate bigint    -> ); Query OK, 0 rows affected (0.63 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1495 values(1570127400); Query OK, 1 row affected (0.14 sec) mysql> insert into ... Read More

How to retrieve the system’s reference to the specified String in C#?

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 05:37:40

87 Views

To retrieve the system’s reference to the specified String, the code is as follows −Example Live Demousing System; public class Demo{    public static void Main(string[] args){       string str1 = "David";       string str2 = string.Intern(str1);       Console.WriteLine("String1 = "+str1);       Console.WriteLine("System ... Read More

Which MySQL data type is used for long decimal?

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 05:34:53

356 Views

For this, use DECIMAL(21, 20). Let us first create a table −mysql> create table DemoTable1493    -> (    -> LongValue DECIMAL(21, 20)    -> ); Query OK, 0 rows affected (0.48 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1493 values(1.0047464644664677373); Query OK, 1 row ... Read More

How to remove element from the specified index of the List in C#?

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 05:33:07

249 Views

To remove the element from the specified index of the List, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(String[] args){       List list = new List();       list.Add("Ryan");       list.Add("Kevin");       ... Read More

Fix MySQL ERROR 1064 (42000) check the manual that corresponds to your MySQL server version for the right syntax to use near ')'

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 05:30:52

4K+ Views

This error may occur if you have used an incorrect syntax. Let’s say the following is the create table statement −mysql> create table DemoTable1492    -> (    -> timestamp TIMESTAMP,    -> event int,    -> ); ERROR 1064 (42000): You have an error in your SQL syntax; check ... Read More

How to play user modified Beep sound through Console in C#?

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 05:29:51

328 Views

To play user modified beep sound through Console, the code is as follows −Example Live Demousing System; public class Demo {    public static void Main(String[] args){       Console.WriteLine("Displaying standard output stream...");       Console.WriteLine("Standard Output Stream = "+Console.Out);       Console.WriteLine("Beep sound through Console");     ... Read More

How to store the PayPal decimal amount in the MySQL database?

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 05:27:28

163 Views

In order to store PayPal decimal amount in the MySQL database, you can use DECIMAL(10, 2). Let us first create a table −mysql> create table DemoTable1491    -> (    -> Amount DECIMAL(10, 2)    -> ); Query OK, 0 rows affected (0.66 sec)Insert some records in the table using ... Read More

Advertisements