AmitDiwan has Published 10740 Articles

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

AmitDiwan

AmitDiwan

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

347 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

105 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

382 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

284 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

351 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

184 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

How to get the HashCode of the tuple in C#?

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 05:26:36

198 Views

To get the HashCode of the tuple, the code is as follows −Example Live Demousing System; public class Demo {    public static void Main(String[] args){       var tuple1 = Tuple.Create(150, 400, 500, 700, 100, 1200, 1500, Tuple.Create(50, 100));       var tuple2 = Tuple.Create(150, 400, 500, 700, ... Read More

Find average of corresponding records (Product Price) from duplicate product ids in MYSQL

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 05:25:02

431 Views

For this, use AVG() for average and GROUP BY to group records of duplicate column (Product Id). Let us first create a table −mysql> create table DemoTable1490    -> (    -> ProductId varchar(20),    -> ProductPrice int    -> ); Query OK, 0 rows affected (0.43 sec)Insert some records ... Read More

How to create a StringCollection in C#?

AmitDiwan

AmitDiwan

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

141 Views

To create a StringCollection in C#, the code is as follows −Example Live Demousing System; using System.Collections.Specialized; public class Demo {    public static void Main(){       StringCollection strCol = new StringCollection();       String[] strArr = new String[] { "A", "B", "C", "D", "E", "F", "G", "H" ... Read More

Advertisements