AmitDiwan has Published 10740 Articles

Remove index from a MySQL table

AmitDiwan

AmitDiwan

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

549 Views

To remove index from a MySQL table, the syntax is as follows −alter table yourTableName drop index `yourIndexName`;Let us first create a table −Mysql> create table DemoTable1469    -> (    -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> StudentName varchar(40),    -> StudentAge int    -> ); ... Read More

Convert a specified value to an equivalent Boolean value in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 07:33:49

501 Views

To convert a specified value to an equivalent Boolean value, the code is as follows −Example Live Demousing System; using System.Globalization; public class Demo {    public static void Main() {       CultureInfo cultures = new CultureInfo("en-US");       String str = "true";       Console.WriteLine("Converted bool ... Read More

Delete rows with duplicate and similar content & get row with maximum number with MySQL select statement?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 07:29:09

117 Views

Let us first create a table −mysql> create table DemoTable1468    -> (    -> Id int,    -> Name varchar(20),    -> Age int    -> ); Query OK, 0 rows affected (1.21 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1468 values(100, 'Chris', 23); ... Read More

Gets or sets the value in HybridDictionary with specified key in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 07:28:29

170 Views

To get or set the value in HybridDictionary with specified key, the code is as follows −Example Live Demousing System; using System.Collections.Specialized; public class Demo {    public static void Main() {       HybridDictionary myDict = new HybridDictionary();       myDict.Add("1", "Tablet");       myDict.Add("2", "Desktop");   ... Read More

Get rows that have common value from the same table with different id in MySQL

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 07:13:42

936 Views

For this, you can use GROUP BY HAVING clause. Let us first create a table −mysql> create table DemoTable1467    -> (    -> Id int,    -> Name varchar(20)    -> ); Query OK, 0 rows affected (0.64 sec)Insert some records in the table using insert command −mysql> insert ... Read More

Gets or sets the value at the specified key in StringDictionary in C#

AmitDiwan

AmitDiwan

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

139 Views

To get or set the value at the specified key in StringDictionary, the code is as follows −Example Live Demousing System; using System.Collections.Specialized; public class Demo {    public static void Main() {       StringDictionary myDict = new StringDictionary();       myDict.Add("1", "Tablet");       myDict.Add("2", "Desktop"); ... Read More

Fastest way to insert with multiple values in a single MySQL query?

AmitDiwan

AmitDiwan

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

594 Views

Do not use the below query for this −insert into yourTableName values(yourValue1, yourValue2, ...N); insert into yourTableName values(yourValue1, yourValue2, ...N); insert into yourTableName values(yourValue1, yourValue2, ...N); . . . NYou can use below query as the fastest way to insert with multiple values in a single query −insert into yourTableName ... Read More

Remove all the strings from the StringCollection in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 07:09:38

155 Views

To remove all the strings from the StringCollection, the code is as follows −Example Live Demousing System; using System.Collections.Specialized; public class Demo {    public static void Main() {       StringCollection stringCol = new StringCollection();       String[] arr = new String[] { "100", "200", "300", "400", "500" ... Read More

How to split string in MySQL using SUBSTRING_INDEX?

AmitDiwan

AmitDiwan

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

281 Views

Let us first create a table −mysql> create table DemoTable1465    -> (    -> Name varchar(40)    -> ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1465 values('Chris Brown'); Query OK, 1 row affected (0.10 sec) mysql> insert ... Read More

Implement DELETE query in MySQL stored procedure

AmitDiwan

AmitDiwan

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

2K+ Views

You can use stored procedure and can pass the value via parameter. Let us first create a table −mysql> create table DemoTable1464    -> (    -> Id int,    -> FirstName varchar(20)    -> ); Query OK, 0 rows affected (0.51 sec)Insert some records in the table using insert ... Read More

Advertisements