AmitDiwan has Published 10744 Articles

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

AmitDiwan

AmitDiwan

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

90 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

256 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

106 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

Get an ICollection containing the keys in the Hashtable C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 06:40:14

173 Views

To get an ICollection containing the keys 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

Use UNION ALL to insert records in two tables with a single query in MYSQL

AmitDiwan

AmitDiwan

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

959 Views

Here is the query to create first table.mysql> create table DemoTable1    -> (    -> StudentName varchar(20),    -> StudentMarks int    -> ); Query OK, 0 rows affected (0.67 sec)To understand the above concept, let us create second table.mysql> create table DemoTable2    -> (    -> Name ... Read More

Get value of the bit at a specific position in BitArray in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 06:36:57

189 Views

To get value of the bit at a specific position in BitArray, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main() {       BitArray arr1 = new BitArray(2);       BitArray arr2 = new BitArray(2);     ... Read More

Get or Set the value associated with specified key in Hashtable in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 06:33:58

169 Views

To get or set the value associated with specified key in 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("1", "AB");       hash.Add("2", "BC"); ... Read More

Ignore null values in MySQL and display rest of the values

AmitDiwan

AmitDiwan

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

2K+ Views

Use IS NOT NULL to find the non-null values and display them. Let us first create a table −mysql> create table DemoTable1458    -> (    -> StudentName varchar(20),    -> StudentScore int    -> ); Query OK, 0 rows affected (0.52 sec)Insert some records in the table using insert ... Read More

MySQL query to convert timestamp to month?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 06:30:40

819 Views

To convert timestamp to month, use the FROM_UNIXTIME() method as in the below syntax −select month(from_unixtime(yourColumnName)) from yourTableName;Let us first create a table −mysql> create table DemoTable1457    -> (    -> Value bigint    -> ); Query OK, 0 rows affected (0.85 sec)Insert some records in the table using ... Read More

Get or set the number of elements that the ArrayList can contain in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 06:29:50

102 Views

To get or set the number of elements that the ArrayList can contain, 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(25);       arrList.Add(50);   ... Read More

Advertisements