AmitDiwan has Published 10740 Articles

DateTimeOffset.AddTicks() Method in C#

AmitDiwan

AmitDiwan

Updated on 12-Nov-2019 07:46:39

232 Views

The DateTimeOffset.AddTicks() method in C# is used to add a specified number of ticks to the value of this instance.SyntaxFollowing is the syntax −public DateTimeOffset AddTicks (long val);Above, the Val is the ticks, which is a number of 100-nanosecond ticks. To subtract ticks, set a negative value.Let us see the ... Read More

Dictionary.Remove() Method in C#

AmitDiwan

AmitDiwan

Updated on 12-Nov-2019 07:43:25

7K+ Views

The Dictionary.Remove() property in C# is used to remove the value with the specified key from the Dictionary.SyntaxFollowing is the syntax −public bool Remove (TKey key);Above, the key is the key to remove.ExampleLet us now see an example to implement the Dictionary.Remove() property −using System; using System.Collections.Generic; public class Demo ... Read More

Dictionary.Keys Property in C#

AmitDiwan

AmitDiwan

Updated on 12-Nov-2019 07:39:00

351 Views

The Dictionary.Keys property in C# is used to fetch all the keys in the Dictionary.SyntaxFollowing is the syntax −public System.Collections.Generic.Dictionary.KeyCollection Keys { get; }ExampleLet us now see an example to implement the Dictionary.Keys property −using System; using System.Collections.Generic; public class Demo {    public static void Main(){       ... Read More

Dictionary.Item[] Property in C#

AmitDiwan

AmitDiwan

Updated on 12-Nov-2019 07:35:43

478 Views

The Dictionary.Item[] property in C# is used to get or set the value associated with the specified key in the Dictionary.SyntaxFollowing is the syntax −public TValue this[TKey key] { get; set; }ExampleLet us now see an example to implement the Dictionary.Item[] property −using System; using System.Collections.Generic; public class Demo { ... Read More

Dictionary.Add() Method in C#

AmitDiwan

AmitDiwan

Updated on 12-Nov-2019 07:32:48

312 Views

The Dictionary.Add() method in C# is used to add a specified key and value to the dictionary.SyntaxFollowing is the syntax −public void Add (TKey key, TValue val);Above, the key parameter is the key, whereas Val is the value of the element.ExampleLet us now see an example to implement the Dictionary.Add() ... Read More

DateTimeOffset.AddSeconds() Method in C#

AmitDiwan

AmitDiwan

Updated on 12-Nov-2019 07:29:25

362 Views

The DateTimeOffset.AddSeconds() method in C# is used to return a new DateTimeOffset object that adds a specified number of whole and fractional seconds to the value of this instance.SyntaxFollowing is the syntax −public DateTimeOffset AddSeconds (double val);Above, Val is the number of seconds to be added. To subtract seconds, set ... Read More

Get the SUM of records between two given dates in MySQL

AmitDiwan

AmitDiwan

Updated on 12-Nov-2019 07:01:39

2K+ Views

For this, use BETWEEN keyword. Let us first create a −mysql> create table DemoTable1444    -> (    -> Value int,    -> PurchaseDate datetime    -> ); Query OK, 0 rows affected (0.45 sec)Insert some records in the table using insert −mysql> insert into DemoTable1444 values(40, '2019-01-10'); Query OK, ... Read More

Effective way to add integers based on table values in MySQL?

AmitDiwan

AmitDiwan

Updated on 12-Nov-2019 07:00:07

113 Views

You need to use GROUP BY clause. Let us first create a −mysql> create table DemoTable1443    -> (    -> StudentId int,    -> StudentScore int    -> ); Query OK, 0 rows affected (0.42 sec)Insert some records in the table using insert −mysql> insert into DemoTable1443 values(100, 78); ... Read More

How to sum rows of VARCHAR datatype or TIME datatype in MySQL?

AmitDiwan

AmitDiwan

Updated on 12-Nov-2019 06:58:28

302 Views

Let us first create a −mysql> create table DemoTable1442    -> (    -> DueTime time    -> ); Query OK, 0 rows affected (0.56 sec)Insert some records in the table using insert −mysql> insert into DemoTable1442 values('00:08:00'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable1442 values('00:04:00'); ... Read More

What is the purpose of ORDER BY columnname*1 in MySQL?

AmitDiwan

AmitDiwan

Updated on 12-Nov-2019 06:57:12

90 Views

MySQL will implicitly convert the column into a number. Following is the syntax −select * from yourTableName  order by yourColumnName*1;Let us first create a −mysql> create table DemoTable1441    -> (    -> Id varchar(30)    -> ); Query OK, 0 rows affected (0.53 sec)Insert some records in the table ... Read More

Advertisements