Articles on Trending Technologies

Technical articles with clear explanations and examples

Perform case insensitive SELECT using MySQL IN()?

AmitDiwan
AmitDiwan
Updated on 10-Dec-2019 281 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 DemoTable1460 values('David'); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable1460 values('Bob'); Query OK, 1 row affected (0.52 sec) mysql> insert into DemoTable1460 values('Robert'); Query OK, 1 row affected (0.11 sec)Display all records from the table using select statement −mysql> select * from DemoTable1460;This will produce the following ...

Read More

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

AmitDiwan
AmitDiwan
Updated on 10-Dec-2019 137 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");       hash.Add("C", "Pet Supplies");       hash.Add("D", "Books");       hash.Add("E", "Toys");       hash.Add("F", "Footwear");       hash.Add("G", "Clothing");       ICollection col = hash.Keys;       foreach(string str in col)       Console.WriteLine(str + ": " + hash[str]);    } }OutputThis ...

Read More

Get an ICollection containing the keys in the Hashtable C#

AmitDiwan
AmitDiwan
Updated on 10-Dec-2019 194 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");       hash.Add("C", "Pet Supplies");       hash.Add("D", "Books");       hash.Add("E", "Toys");       hash.Add("F", "Footwear");       hash.Add("G", "Clothing");       ICollection col = hash.Keys;       foreach(string str in col)       Console.WriteLine(str + ": " + hash[str]);    } }OutputThis ...

Read More

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

AmitDiwan
AmitDiwan
Updated on 10-Dec-2019 983 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 varchar(20)    -> ); Query OK, 0 rows affected (0.61 sec)Insert some records in the table using insert command −mysql> insert into DemoTable2 values('Chris'); Query OK, 1 row affected (0.12 sec)Display all records from the table using select statement −mysql> select * from DemoTable2;This will produce the following output −+-------+ ...

Read More

What is difference between innerWidth and outerWidth in jQuery?

Alex Onsman
Alex Onsman
Updated on 10-Dec-2019 337 Views

innerWidth in jQueryThe innerWidth() returns the inner width of the first matched element. It includes padding, but not border and margin.ExampleYou can try to run the following code to get the inner width in jQuery:Live Demo $(document).ready(function(){     $("button").click(function(){         alert("Inner Width of div element: " + $("div").innerWidth());     }); }); Get Inner Width of div outerWidth in jQueryThe outerWidth() returns the outer width of the first matched element. It includes padding and border.ExampleYou can try to run the following code to ...

Read More

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

AmitDiwan
AmitDiwan
Updated on 10-Dec-2019 198 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");       hash.Add("3", "DE");       hash.Add("4", "EF");       hash.Add("5", "GH");       hash.Add("6", "IJ");       hash.Add("7", "KL");       hash.Add("8", "MN");       hash.Add("9", "OP");       hash.Add("10", "QR");       Console.WriteLine("Value at key 3 = "+hash["3"]);   ...

Read More

Ignore null values in MySQL and display rest of the values

AmitDiwan
AmitDiwan
Updated on 10-Dec-2019 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 command −mysql> insert into DemoTable1458 values('Chris Brown', 56); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable1458 values('David Miller', NULL); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable1458 values('John Doe', 78); Query OK, 1 row affected (0.08 sec) mysql> insert into DemoTable1458 values('Adam Smith', NULL); ...

Read More

MySQL query to convert timestamp to month?

AmitDiwan
AmitDiwan
Updated on 10-Dec-2019 877 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 insert command −mysql> insert into DemoTable1457 values(1570207117); Query OK, 1 row affected (0.07 sec) mysql> insert into DemoTable1457 values(1548947534); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable1457 values(1575213134); Query OK, 1 row affected (0.13 sec)Display all records from the table using select statement −mysql> select * from ...

Read More

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

AmitDiwan
AmitDiwan
Updated on 10-Dec-2019 140 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);       arrList.Add(75);       arrList.Add(100);       arrList.Add(125);       arrList.Add(150);       arrList.Add(175);       arrList.Add(200);       arrList.Add(225);       arrList.Add(250);       Console.WriteLine("Elements in ArrayList...");       foreach(int i in arrList) {          Console.WriteLine(i); ...

Read More

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

AmitDiwan
AmitDiwan
Updated on 10-Dec-2019 136 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);       list.Add("C ", 3);       list.Add("D", 4);       list.Add("E", 5);       list.Add("F", 6);       list.Add("G", 7);       list.Add("H", 8);       Console.WriteLine("SortedList elements...");       foreach(DictionaryEntry d in list) {          Console.WriteLine(d.Key + ...

Read More
Showing 52601–52610 of 61,248 articles
Advertisements