AmitDiwan has Published 10744 Articles

StringDictionary Class in C#?

AmitDiwan

AmitDiwan

Updated on 16-Dec-2019 06:50:36

217 Views

The StringDictionay class implements a hash table with the key and the value strongly typed to be strings rather than objects.Following are the properties of the StringDictionary class −Sr.NoProperty & Description1CountGets the number of key/value pairs in the StringDictionary.2IsSynchronizedGets a value indicating whether access to the StringDictionary is synchronized (thread ... Read More

Combine two MySQL fields and update a third one with result?

AmitDiwan

AmitDiwan

Updated on 16-Dec-2019 06:49:03

526 Views

Following is the syntax to combine two fields in MySQL −alter table yourTableName add column yourColumnName dataType;  update yourTableName set yourAddedColumnName =concat(yourColumnName1, ' ', yourColumnName2);Let us first create a table −mysql> create table DemoTable1590    -> (    -> FirstName varchar(20),    -> LastName varchar(20)    -> ); Query OK, ... Read More

Can we create a database with a numeric name with MySQL?

AmitDiwan

AmitDiwan

Updated on 16-Dec-2019 06:46:28

404 Views

You cannot create database with numeric name as shown below −mysql> create database 1233;This will produce the following output −ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1233' at ... Read More

How to get Synchronize access to the HybridDictionary in C#?

AmitDiwan

AmitDiwan

Updated on 16-Dec-2019 06:45:29

115 Views

To get synchronize access to HybridDictionary, the code is as follows −Exampleusing System; using System.Collections; using System.Collections.Specialized; public class Demo {    public static void Main() {       HybridDictionary dict1 = new HybridDictionary();       dict1.Add("A", "Books");       dict1.Add("B", "Electronics");       dict1.Add("C", "Smart ... Read More

How can I see how long statements take to execute on the MySQL command line?

AmitDiwan

AmitDiwan

Updated on 16-Dec-2019 06:44:39

167 Views

For every single statement on MySQL command line, it shows the exact time to execute the specific statement.Let us first create a table −mysql> create table DemoTable1589    -> (    -> EmployeeId int,    -> EmployeeName varchar(20)    -> ); Query OK, 0 rows affected (0.56 sec)Insert some records ... Read More

Select maximum of sum of two columns in MySQL

AmitDiwan

AmitDiwan

Updated on 16-Dec-2019 06:42:04

615 Views

To select maximum of sum of two columns, use aggregate function MAX() along with subquery. Let us first create a table −mysql> create table DemoTable1587    -> (    -> Value1 int,    -> Value2 int    -> ); Query OK, 0 rows affected (0.59 sec)Insert some records in the ... Read More

HybridDictionary Class in C#?

AmitDiwan

AmitDiwan

Updated on 16-Dec-2019 06:41:19

181 Views

The HybridDictionary class implements IDictionary by using a ListDictionary while the collection is small, and then switching to a Hashtable when the collection gets large.Following are the properties of the HybridDictionary class −Sr.NoProperty & Description1CountGets the number of key/value pairs contained in the HybridDictionary.2IsFixedSizeGets a value indicating whether the HybridDictionary ... Read More

Display information about field names in MySQL including TYPE, KEY, etc.

AmitDiwan

AmitDiwan

Updated on 16-Dec-2019 06:39:14

113 Views

To display information about field names, the syntax is as follows −show columns from yourTableName;Let us first create a table −mysql> create table DemoTable1586    -> (    -> EmployeeId int,    -> EmployeeFirstName varchar(20),    -> EmployeeLastName varchar(20),    -> EmployeeAge int,    -> EmployeeCountryName varchar(20),    -> EmployeeSalary ... Read More

What will happen if we have set UNIQUE and multiple insertion with duplicate values

AmitDiwan

AmitDiwan

Updated on 16-Dec-2019 06:35:52

131 Views

An error will arise and nothing will get inserted in the table Let us see an example and create a table −mysql> create table DemoTable1585    -> (    -> StudentId int,    -> StudentMarks int,    -> UNIQUE(StudentId)    -> ); Query OK, 0 rows affected (1.02 sec)Insert some ... Read More

How to get Synchronize access to an Array in C#?

AmitDiwan

AmitDiwan

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

151 Views

To get synchronize access to an array, the code is as follows −Example Live Demousing System; public class Demo {    public static void Main() {       Array intArr = new int[] {5, 10, 15, 20, 25, 30, 35, 40 };       Console.WriteLine("Integer array...");       ... Read More

Advertisements