AmitDiwan has Published 10740 Articles

Get an ICollection containing the keys in the Hashtable C#

AmitDiwan

AmitDiwan

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

185 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

976 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

230 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

193 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

859 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

124 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

Getting the list of Values of a SortedList object in C#

AmitDiwan

AmitDiwan

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

125 Views

To get the list of values of a 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", 1);       list.Add("B ", 2); ... Read More

Perform MySQL search between two dates

AmitDiwan

AmitDiwan

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

543 Views

To perform MySQL search between two dates, use BETWEEN keyword. Let us first create a table −mysql> create table DemoTable1456    -> (    -> CustomerName varchar(30),    -> StartOfferDate  date,    -> EndOfferDate date    -> ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table ... Read More

Getting the list of keys of a SortedList object in C#

AmitDiwan

AmitDiwan

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

765 Views

To get the list of keys of a SortedList object, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main(String[] args) {       SortedList list1 = new SortedList();       list1.Add("One", 1);       list1.Add("Two ", 2); ... Read More

Advertisements