AmitDiwan has Published 10744 Articles

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

AmitDiwan

AmitDiwan

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

169 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

411 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

119 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

Get sum of column with conditions in MySQL

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 05:21:21

342 Views

Let us first create a table −mysql> create table DemoTable1489    -> (    -> ProductId int,    -> ProductPrice int    -> ); Query OK, 0 rows affected (0.49 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1489 values(100, 900); Query OK, 1 row affected ... Read More

Using EXPLAIN keyword in MySQL

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 05:12:01

389 Views

MySQL EXPLAIN gives a query execution plan. EXPLAIN can be used in the beginning with SELECT, INSERT, DELETE, REPLACE, and UPDATE.To avoid the complete table scan in database, you need to use index. Let us first create a table −mysql> create table DemoTable1488    -> (    -> StudentId int, ... Read More

How to create a shallow copy of SortedList Object in C#?

AmitDiwan

AmitDiwan

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

217 Views

To create a shallow copy of SortedList object, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main(String[] args){       SortedList list = new SortedList();       list.Add("A", "Jacob");       list.Add("B", "Sam");       list.Add("C", ... Read More

Sort data column to retrieve max textual value in MySQL

AmitDiwan

AmitDiwan

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

109 Views

For this, you can use ORDER BY along with some aggregate function right(). Let us first create a table −mysql> create table DemoTable1487    -> (    -> StudentCode text    -> ); Query OK, 0 rows affected (0.91 sec)Insert some records in the table using insert command −mysql> insert ... Read More

How to fetch the newly added records from a MySQL table?

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 05:06:49

611 Views

For this, you can use ORDER BY with LIMIT. Here, LIMIT is used to set the limit (count) of records you want to fetch. Let us first create a table −mysql> create table DemoTable1486    -> (    -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> StudentName varchar(20) ... Read More

How to play Beep sound through Console in C#?

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 05:05:47

260 Views

To play 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");       Console.Beep(); ... Read More

How to perform a specified action on each element of the List in C#?

AmitDiwan

AmitDiwan

Updated on 11-Dec-2019 05:03:03

233 Views

To perform a specified action on each element of the List, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void demo(int s){       s = s * 10;       Console.WriteLine(s);    }    public static void Main(String[] ... Read More

Advertisements