AmitDiwan has Published 10740 Articles

How to find the Capacity of a StringBuilder in C#

AmitDiwan

AmitDiwan

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

144 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

246 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

222 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

1K+ 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

187 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

127 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

Count NOT NULL values from separate tables in a single MySQL query

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 07:58:11

229 Views

To count values from separate tables, the syntax is as follows −Select    (    select count(yourColumnName) from yourTableName1) as anyAliasName1,    (    select count(yourColumnName) from yourTableName2) as anyAliasName2;Let us first create a table −mysql> create table DemoTable1    -> (    -> Id int    -> ); Query ... Read More

OrderedDictionary Class in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 07:56:50

967 Views

The OrderedDictionary class represents a collection of key/value pairs that are accessible by the key or index.Following are the properties of OrderedDictionary class −Sr.noProperty & Description1CountGets the number of key/values pairs contained in the OrderedDictionary collection.2IsReadOnlyGets a value indicating whether the OrderedDictionary collection is read-only.3Item[Int32]Gets or sets the value at ... Read More

Reorder keys after deleting a record from MySQL table?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 07:53:47

557 Views

For this, use UPDATE command with some mathematical calculations. To delete an id, use the DELETE. Let us first create a table −mysql> create table DemoTable1476    -> (    -> Id int    -> ); Query OK, 0 rows affected (0.81 sec)Insert some records in the table using insert ... Read More

Advertisements