AmitDiwan has Published 10740 Articles

Removing all the elements from the List in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 07:05:10

200 Views

To remove all the elements from 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 list1 = new List();       list1.Add("One");       list1.Add("Two");       list1.Add("Three");   ... Read More

Concatenate multiple rows and columns in a single row with MySQL

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 07:02:27

2K+ Views

To concatenate multiple rows and columns in single row, you can use GROUP_CONCAT() along with CONCAT(). Let us first create a table −mysql> create table DemoTable1463    -> (    -> ClientId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> ClientName varchar(20),    -> ClientAge int    -> ); Query ... Read More

Perform mathematical calculations in a MySQL table with NULL and NON-NULL values

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 07:00:25

291 Views

For this, you can use IFNULL() and perform mathematical calculations with NULL and NON-NULL values. Let us first create a table −mysql> create table DemoTable1462    -> (    -> Value1 int,    -> Value2 int    -> ); Query OK, 0 rows affected (0.55 sec)Insert some records in the ... Read More

Get the number of elements contained in Collection in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 06:59:45

142 Views

To get the number of elements contained in Collection, the code is as follows −Example Live Demousing System; using System.Collections.ObjectModel; public class Demo {    public static void Main() {       Collection col = new Collection();       col.Add("Andy");       col.Add("Kevin");       col.Add("John");   ... Read More

MySQL ORDER BY 'ENUM' type value based on conditions

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 06:56:49

546 Views

For this, use ORDER BY CASE statement. Let us first create a table, wherein we have ENUM type column −mysql> create table DemoTable1461    -> (    -> DeckOfCards ENUM('K', 'J', 'A', 'Q')    -> ); Query OK, 0 rows affected (0.64 sec)Insert some records in the table using insert ... Read More

Gets or Sets the element at the specified index in the List in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 06:55:43

173 Views

To get or set the element ate the specified index in 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("100");       list.Add("200"); ... Read More

Fetch the size of a specific column values in MySQL and display the sum

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 06:48:53

169 Views

Let us first create a table −mysql> create table DemoTable1612    -> (    -> FirstName varchar(20),    -> LastName varchar(20)    -> ); Query OK, 0 rows affected (0.87 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1612 values('David', 'Brown'); Query OK, 1 row affected ... Read More

Gets or sets the element at the specified index in StringCollection in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 06:47:59

110 Views

To get or set the element at the specified index in StringCollection, 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", ... Read More

Perform case insensitive SELECT using MySQL IN()?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 06:43:45

274 Views

Let us first create a table −mysql> create table DemoTable1460    -> (    -> Name varchar(20)    -> ); Query OK, 0 rows affected (0.91 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1460 values('Chris'); Query OK, 1 row affected (0.15 sec) mysql> insert into ... Read More

Gets an ICollection containing the values in the Hashtable in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 06:42:56

128 Views

To get an ICollection containing the values in the Hashtable, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main() {       Hashtable hash = new Hashtable();       hash.Add("A", "Electronics");       hash.Add("B", "Appliances");     ... Read More

Advertisements