AmitDiwan has Published 10744 Articles

StringCollection Class in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 08:13:49

777 Views

The StringCollection class represents a collection of strings. Following are the properties of the StringCollection class −Sr.noProperty & Description1CountGets the number of key/values pairs contained in the OrderedDictionary collection.2IsReadOnlyGets a value indicating whether the StringCollection is read-only..3IsSynchronizedGets a value indicating whether access to the StringCollection is synchronized (thread safe).4Item[Int32]Gets or ... Read More

Perform MySQL SELECT INTO user-defined variable

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 08:11:30

275 Views

Let us first create a table −mysql> create table DemoTable1483    -> (    -> Salary int    -> ); Query OK, 0 rows affected (0.41 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1483 values(100); Query OK, 1 row affected (0.17 sec) mysql> insert into ... Read More

How to display the result more readable if the string is long stored in MySQL VARCHAR?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 08:09:14

448 Views

For this, use \G as in the below syntax −select * from yourTableName\GLet us first create a table −mysql> create table DemoTable1482    -> (    -> Title varchar(255)    -> ); Query OK, 0 rows affected (0.52 sec)Insert some records in the table using insert command −mysql> insert into ... Read More

How to find the Capacity of a StringBuilder in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 08:08:03

101 Views

To find the capacity of a StringBuilder in C#, the code is as follows −Example Live Demousing System; using System.Text; public class Demo {    public static void Main(String[] args) {       StringBuilder strBuilder1 = new StringBuilder("Tim");       StringBuilder strBuilder2 = new StringBuilder("Tom");       StringBuilder ... Read More

How to replace rows in a MySQL table with conditions?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 08:06:43

222 Views

To set conditions and replace rows, use MySQL CASE statement. Let us first create a table −mysql> create table DemoTable1481    -> (    -> PlayerScore int    -> ); Query OK, 0 rows affected (0.42 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1481 values(454); ... Read More

Total number of elements present in an array in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 08:05:46

193 Views

To get the total number of elements present in an array, the code is as follows −Example Live Demousing System; public class Demo {    public static void Main() {       string[] products = { "Electronics", "Accessories", "Clothing", "Toys", "Clothing", "Furniture" };       Console.WriteLine("Products list...");     ... Read More

How do I write not greater than in a MySQL query?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 08:03:33

961 Views

The not greater than in a query can be written simply like less than or equal to ( (    -> StudentName varchar(40),    -> StudentMarks int    -> ); Query OK, 0 rows affected (0.50 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1480 ... Read More

How to create the StringBuilder in C#?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 08:02:32

155 Views

To create StringBuilder in C#, the code is as follows −Example Live Demousing System; using System.Text; public class Demo {    public static void Main(String[] args) {       StringBuilder strBuilder1 = new StringBuilder("Tim");       StringBuilder strBuilder2 = new StringBuilder("Tom");       Console.WriteLine("Is StringBuilder1 equal to StringBuilder2? ... Read More

Can we insert records in a MySQL table without auto_increment values?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 08:00:33

1K+ Views

Yes, we can insert without the auto_increment since it gets inserted on its own. Let us first create a table −mysql> create table DemoTable1479    -> (    -> EmployeeId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> EmployeeSalary int    -> ); Query OK, 0 rows affected (0.86 sec)Insert ... Read More

How to create an OrderedDictionary in C#?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 07:59:41

104 Views

To create an OrderedDictionary in C#, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo {    public static void Main() {       OrderedDictionary dict = new OrderedDictionary();       dict.Add("A", "Books");       dict.Add("B", "Electronics");       dict.Add("C", ... Read More

Advertisements