AmitDiwan has Published 10740 Articles

Format MySQL records (price values) after multiplying them

AmitDiwan

AmitDiwan

Updated on 17-Dec-2019 05:36:53

214 Views

To format records, use FORMAT(). Let us first create a table −mysql> create table DemoTable    -> (    -> Price decimal(10, 4),    -> Rate decimal(10, 4)    -> ); Query OK, 0 rows affected (0.96 sec)Insert some records in the table using insert command −mysql> insert into DemoTable ... Read More

MySQL LIKE command doesn't work with strings containing dots to display records beginning with a specific number

AmitDiwan

AmitDiwan

Updated on 17-Dec-2019 05:34:46

530 Views

To work with strings containing dots, and display records beginning with a specific number, you need to use REGEXP. Let us first create a table −mysql> create table DemoTable    -> (    -> GameReleaseVersion varchar(20)    -> ); Query OK, 0 rows affected (0.57 sec)Insert some records in the ... Read More

Setting the capacity to the actual number of elements in a SortedList object in C#?

AmitDiwan

AmitDiwan

Updated on 16-Dec-2019 12:37:04

158 Views

To set the capacity to the actual number of elements in 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 sortedList = new SortedList();       sortedList.Add("A", "1");     ... Read More

Total number of elements in a specified dimension of an Array in C#

AmitDiwan

AmitDiwan

Updated on 16-Dec-2019 10:28:34

141 Views

To get the total number of elements in a specified dimension of an array, the code is as follows −Example Live Demousing System; public class Demo {    public static void Main() {       string[] products = new string[] { "Andy", "Mark", "Gary", "Andre"};       Console.WriteLine("One or ... Read More

Set the capacity to the actual number of elements in the ArrayList in C#?

AmitDiwan

AmitDiwan

Updated on 16-Dec-2019 10:18:04

145 Views

To set the capacity to the actual number of elements in the ArrayList, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main(String[] args) {       ArrayList list1 = new ArrayList();       list1.Add("A");       list1.Add("B"); ... Read More

Search for an element matching the conditions and return the zero-based index of the last occurrence within the entire List in C#

AmitDiwan

AmitDiwan

Updated on 16-Dec-2019 10:13:38

234 Views

To search for an element matching the conditions and return the zero-based index of the last occurrence within the entire List, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    private static bool demo(int i) {       return ((i % 10) == ... Read More

Searching the index of specified object in Collection in C#

AmitDiwan

AmitDiwan

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

174 Views

To search the index of specified object in Collection, the code is as follows −Example Live Demousing System; using System.Collections.Specialized; public class Demo {    public static void Main() {       StringCollection strCol = new StringCollection();       strCol.Add("Accessories");       strCol.Add("Books");       strCol.Add("Electronics");   ... Read More

Number of elements contained in the BitArray in C#?

AmitDiwan

AmitDiwan

Updated on 16-Dec-2019 10:04:35

116 Views

To get the number of elements contained in the BitArray, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main() {       BitArray arr1 = new BitArray(5);       BitArray arr2 = new BitArray(5);       arr1[0] ... Read More

How to check whether a thread is alive or not in C#

AmitDiwan

AmitDiwan

Updated on 16-Dec-2019 10:00:54

621 Views

To check whether a thread is alive or not, the code is as follows −Example Live Demousing System; using System.Threading; public class Demo {    public static void Main() {       Thread thread = new Thread(new ThreadStart(demo1));       thread = Thread.CurrentThread;       Console.WriteLine("Is the thread ... Read More

Search in a SortedList object in C#

AmitDiwan

AmitDiwan

Updated on 16-Dec-2019 09:57:40

226 Views

To search in a SortedList object, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main() {       SortedList list = new SortedList();       list.Add("1", "One");       list.Add("2", "Two");       list.Add("3", "Three");   ... Read More

Advertisements