AmitDiwan has Published 10744 Articles

Remove all the strings from the StringCollection in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 07:09:38

138 Views

To remove all the strings from the StringCollection, the code is as follows −Example Live Demousing System; using System.Collections.Specialized; public class Demo {    public static void Main() {       StringCollection stringCol = new StringCollection();       String[] arr = new String[] { "100", "200", "300", "400", "500" ... Read More

How to split string in MySQL using SUBSTRING_INDEX?

AmitDiwan

AmitDiwan

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

265 Views

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

Implement DELETE query in MySQL stored procedure

AmitDiwan

AmitDiwan

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

2K+ Views

You can use stored procedure and can pass the value via parameter. Let us first create a table −mysql> create table DemoTable1464    -> (    -> Id int,    -> FirstName varchar(20)    -> ); Query OK, 0 rows affected (0.51 sec)Insert some records in the table using insert ... Read More

Removing all the elements from the List in C#

AmitDiwan

AmitDiwan

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

161 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

1K+ 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

267 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

120 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

508 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

151 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

140 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

Advertisements