AmitDiwan has Published 10740 Articles

How to find the MaxCapacity of a StringBuilder in C#?

AmitDiwan

AmitDiwan

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

272 Views

To find the MaxCapacity of a StringBuilder, 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("Amy");       StringBuilder strBuilder2 = new StringBuilder("Katie");       StringBuilder strBuilder3 ... Read More

A single MySQL select query on two tables is possible?

AmitDiwan

AmitDiwan

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

296 Views

Yes, it is possible. Following is the syntax −select * from yourTableName1, yourTableName2;Let us first create a table −mysql> create table DemoTable1    -> (    -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY    -> ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using ... Read More

How to find the length of the StringBuilder in C#?

AmitDiwan

AmitDiwan

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

280 Views

To find the length of the 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("Amy");       StringBuilder strBuilder2 = new StringBuilder("Katie");       StringBuilder ... Read More

Fetch a value between different values in MySQL

AmitDiwan

AmitDiwan

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

180 Views

Use MySQL BETWEEN to fetch a value between different values. Let us first create a table −mysql> create table DemoTable1473    -> (    -> EmployeeCode varchar(20)    -> ); Query OK, 0 rows affected (0.47 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1473 values('EMP_120'); ... Read More

How to create a StringDictionary in C#?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 07:44:37

112 Views

To create a StringDictionary 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() {       StringDictionary strDict = new StringDictionary();       strDict.Add("A", "John");       strDict.Add("B", "Andy");       strDict.Add("C", ... Read More

How to convert char field to datetime field in MySQL?

AmitDiwan

AmitDiwan

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

408 Views

Let us first create a table. Here, we have declared dates in char type −mysql> create table DemoTable1472    -> (    -> ShippingDate char(35)    -> ); Query OK, 0 rows affected (0.46 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1472 values('12/31/2017 10:50'); Query ... Read More

How to create a shallow copy of Hashtable in C#?

AmitDiwan

AmitDiwan

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

299 Views

To create a shallow copy of Hashtable, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main() {       Hashtable hash = new Hashtable();       hash.Add("1", "AB");       hash.Add("2", "BC");       hash.Add("3", "DE"); ... Read More

MySQL query to calculate the days between two dates from different columns but similar rows

AmitDiwan

AmitDiwan

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

387 Views

Let us first create a table −mysql> create table DemoTable1471    -> (    -> EmployeeJoiningDate date,    -> EmployeeRelievingDate date    -> ); Query OK, 0 rows affected (0.57 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1471 values('2018-06-21', '2018-12-21'); Query OK, 1 row affected ... Read More

Select a field and if it's null, select another with MySQL?

AmitDiwan

AmitDiwan

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

174 Views

For this, use COALESCE(). Let us first create a table −mysql> create table DemoTable1470    -> (    -> FirstName varchar(20),    -> Age int    -> ); Query OK, 0 rows affected (0.57 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1470 values('Robert', 23); Query ... Read More

Get the type referenced by the specified type handle in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 07:36:55

252 Views

To get the type referenced by the specified type handle, the code is as follows −Example Live Demousing System; public class Demo {    public static void Main() {       Type type1 = typeof(short);       RuntimeTypeHandle typeHandle = Type.GetTypeHandle(type1);       Type type = Type.GetTypeFromHandle(typeHandle);   ... Read More

Advertisements