Giri Raju has Published 90 Articles

Print number with commas as 1000 separators in C#

Giri Raju

Giri Raju

Updated on 22-Jun-2020 12:57:50

1K+ Views

Firstly, set the number as string −string num = "1000000.8765";Now, work around differently for number before and after the decimal −string withoutDecimals = num.Substring(0, num.IndexOf(".")); string withDecimals = num.Substring(num.IndexOf("."));Use the ToString() method to set the format for 1000 separators −ToString("#, ##0")The following is the complete code to display number with ... Read More

Global and Local Variables in C#

Giri Raju

Giri Raju

Updated on 22-Jun-2020 12:51:26

3K+ Views

Local VariablesA local variable is used where the scope of the variable is within the method in which it is declared. They can be used only by statements that are inside that function or block of code.Example Live Demousing System; public class Program {    public static void Main() {   ... Read More

How can we simulate the MySQL INTERSECT query returning multiple expressions?

Giri Raju

Giri Raju

Updated on 22-Jun-2020 12:35:18

134 Views

Since we cannot use the INTERSECT query in MySQL, we will use the EXIST operator to simulate the INTERSECT query. It can be understood with the help of the following example −ExampleIn this example, we are two tables namely Student_detail and Student_info having the following data −mysql> Select * from ... Read More

How to empty a C# list?

Giri Raju

Giri Raju

Updated on 22-Jun-2020 12:29:44

13K+ Views

To empty a C# list, use the Clear() method.Firstly, set a list and add elements −List myList = new List() {    "one",    "two",    "three",    "four",    "five",    "six" };Now, let us empty the list −myList.Clear();Example Live Demousing System; using System.Collections.Generic; public class Program {    public ... Read More

How can I check the tables of databases other than current database?

Giri Raju

Giri Raju

Updated on 22-Jun-2020 12:14:06

66 Views

With the help of following MySQL command, we can check the tables of a database other than the database we are currently using −Show Tables from Database_name;For example, the following query would display the list of tables from a database named ‘gaurav’ when currently we are using a database named ... Read More

What happens if I use both G and semicolon (;) termination symbol with a single MySQL statement?

Giri Raju

Giri Raju

Updated on 22-Jun-2020 11:21:31

317 Views

As we know that \G option sends the command to MySQL server for execution and with the help of Semicolon (;) MySQL determines the end of the statement. It is also known that both of them have a different format of the result set.Now, if we will use both of ... Read More

How the MySQL command that you are in the process of entering can be canceled?

Giri Raju

Giri Raju

Updated on 22-Jun-2020 10:59:45

52 Views

Suppose if we do not want to execute a command that we are entering, then we can use a clear \c option which clears the current input. For example, the use of \c option can be done as follows −mysql> Select *     -> from\cIn the example above, when ... Read More

Role of CSS :nth-last-child(n) Selector

Giri Raju

Giri Raju

Updated on 22-Jun-2020 07:29:12

129 Views

Use the CSS :nth-last-child(n) selector to style every element that is the child of its parent, counting from the last child.You can try to run the following code to implement the :nth-last-child(n) selector −ExampleLive Demo                    p:nth-last-child(4) {   ... Read More

How MySQL REPEAT loop statement can be used in stored procedure?

Giri Raju

Giri Raju

Updated on 22-Jun-2020 06:07:11

672 Views

As we know that MySQL provides us loop statements that allow us to execute a block of SQL code repeatedly based on a condition. A REPEAT loop statement is one of such kind of loop statement. Its syntax is as follows −REPEAT    statements; UNTIL expression END REPEATFirst of all, MySQL ... Read More

Role of margin property with value inherit using CSS

Giri Raju

Giri Raju

Updated on 22-Jun-2020 05:24:06

277 Views

The margin property with value inherit is used to inherit an element from the parent element. You can try to run the following code to implement margin: inherit;ExampleLive Demo                    div {             border: 2px ... Read More

Advertisements