AmitDiwan has Published 10744 Articles

Get or set the element at the specified index in ArrayList in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 06:04:38

967 Views

To get or set the element at the specified index in ArrayList, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main() {       ArrayList arrList = new ArrayList();       arrList.Add("Laptop");       arrList.Add("Desktop");     ... Read More

Count multiple rows and display the result in different columns (and a single row) with MySQL

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 06:02:38

719 Views

Let us first create a table −mysql> create table DemoTable1452    -> (    -> FavouriteColor varchar(50)    -> ); Query OK, 0 rows affected (2.42 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1452 values('Red'); Query OK, 1 row affected (0.31 sec) mysql> insert into ... Read More

Get or set the element at specified index in Collection in C#

AmitDiwan

AmitDiwan

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

262 Views

To get or set the element at specified index 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("Laptop");       col.Add("Desktop");       ... Read More

How to update a MySQL date type column?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 05:59:19

391 Views

Let us first create a table −mysql> create table DemoTable1451    -> (    -> JoiningDate date    -> ); Query OK, 0 rows affected (0.52 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1451 values('2019-07-21'); Query OK, 1 row affected (0.07 sec) mysql> insert into ... Read More

Get or Set at specified index in StringCollection in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 05:58:23

144 Views

To get or set at 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", "B", "C", "D", ... Read More

Display matching repeated date records only once in MySQL

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 05:56:12

156 Views

Let’s say we are finding records matching with the current date. Since we want repeated matching records only once, use LIMIT.For example, the current date is −2019-10-02Let us first create a table −mysql> create table DemoTable1450    -> (    -> DueDate date    -> ); Query OK, 0 rows ... Read More

Check if SortedSet and a specified collection share common elements in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 05:55:19

103 Views

To check if SortedSet and a specified collection share common element, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main() {       SortedSet set1 = new SortedSet();       set1.Add(100);       set1.Add(200);       ... Read More

Return maximum value from records in MySQL

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 05:53:12

183 Views

Let us first create a table −mysql> create table DemoTable1449    -> (    -> PlayerId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> PlayerScore int    -> ); Query OK, 0 rows affected (0.69 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1449(PlayerScore) values(1040); Query ... Read More

Check if the current date falls in a given date range using MySQL query

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 05:50:53

841 Views

Let us first create a table −mysql> create table DemoTable1448    -> (    -> StartDate date,    -> EndDate date    -> ); Query OK, 0 rows affected (0.46 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1448 values('2019-01-21', '2019-03-22'); Query OK, 1 row affected ... Read More

MySQL db query to fetch records from comma separate values on the basis of a specific value

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 05:47:04

172 Views

For this, you can use REGEXP in MySQL. Let’s say you want the row records wherein any of the comma separated value is 90. For this, use regular expression.Let us first create a table −mysql> create table DemoTable1447    -> (    -> Value varchar(100)    -> ); Query OK, ... Read More

Advertisements