Declare Variables in C#

Samual Sam
Updated on 20-Jun-2020 10:44:25

389 Views

Each variable in C# has a specific type, which determines the size and layout of the variable's memory the range of values that can be stored within that memory and the set of operations that can be applied to the variable.To declare variables − ;Let us see an example to declare two integer variables −int a, b;Above the variable is of int type. Let us declare a variable for other types −Variable of float type.float f;Variable of double type.double d;Let us display a variable −Example Live Demousing System; using System.Collections; class Demo {    static void Main() {     ... Read More

Restore Multiple Databases or All Databases from mysqldump

mkotla
Updated on 20-Jun-2020 10:43:22

4K+ Views

Suppose if we have dumped multiple databases or all the databases and now want to restore it then we can do it with the following example −C:\mysql\bin>mysql -u root < tutorials_query1.sqlWith the help of above query, we are restoring the dumped multiple databases named ‘tutorials’ and ‘query1’, which are dumped in the file named ‘tutorials_query1.sql’. In this case, we do not need to write the name of the database.Similarly, with the help of the following query, we can restore all the databases dumped by mysqldump −C:\mysql\bin>mysql -u root < alldatabases.sqlWith the help of above query, we are restoring all the ... Read More

Member Functions of a Class in C#

Samual Sam
Updated on 20-Jun-2020 10:43:18

3K+ Views

A member function of a class is a function that has its definition or its prototype within the class definition similar to any other variable. It operates on an object of the class of which it is a member, and has access to all the members of a class for that object.The following is an example of a member function −public void setLength( double len ) {    length = len; } public void setBreadth( double bre ) {    breadth = bre; }The following is an example showing how to access member functions in C#.Example Live Demousing System; namespace ... Read More

MySQL QUOTE Function with Comparison Values

Arjun Thakur
Updated on 20-Jun-2020 10:42:27

146 Views

When QUOTE() function used with WHERE clause then the output depends upon the comparison values returned by WHERE clause. Following example will exhibit it −Examplemysql> Select Name, ID, QUOTE(Subject)AS Subject from Student WHERE Subject = 'History'; +-------+------+-----------+ | Name  | ID   | Subject   | +-------+------+-----------+ | Aarav | 2    | 'History' | +-------+------+-----------+ 1 row in set (0.00 sec)

Member Variables of a Class in C#

karthikeya Boyini
Updated on 20-Jun-2020 10:42:05

4K+ Views

A class is a blueprint that has member variables and functions in C#. This describes the behavior of an object.Let us see the syntax of a class to learn what are member variables − class class_name {    // member variables     variable1;     variable2;    ...     variableN;    // member methods     method1(parameter_list) {       // method body    }     method2(parameter_list) {       // method body    }    ...     methodN(parameter_list) {       // method body    } ... Read More

Backup a Single Database Using mysqldump Client Program

varma
Updated on 20-Jun-2020 10:41:02

177 Views

By using mysqldump client program we can take the backup of a database into a file having the extension ‘.sql’. it can be understood with the help of following example −ExampleIn this example, with the help of mysqldump client program, we are taking the backup of a database named ‘tutorials’ in a file named ‘tutorials.sql’. The following command will do this −C:\mysql\bin>mysqldump -u root tutorials > tutorials.sqlThe above command will create a file named ‘turorials.sql’ in the bin folder of MySQL. This file will contain drop table, create a table and insert command for all the tables in the tutorials ... Read More

Define a Rectangular Array in C#

Samual Sam
Updated on 20-Jun-2020 10:40:44

1K+ Views

Multi-dimensional arrays are also called rectangular array. You can define a 3-dimensional array of integer as −int [ , , ] a;Let us see how to define a two-dimensional array −Int[, ] a = new[3, 3]The following is an example showing how to work with a multi-dimensional i.e. rectangular array in C# −Example Live Demousing System; namespace Demo {    class Program {       static void Main(string[] args) {          int[, ] a = new int[3, 3];          a[0, 1]= 1;          a[0, 2]= 2;     ... Read More

Backup Multiple Databases Using mysqldump

Vrundesha Joshi
Updated on 20-Jun-2020 10:40:35

3K+ Views

By using mysql dump client program we can take the backup of multiple databases into a file having the extension ‘.sql’. It can be understood with the help of the following example −ExampleIn this example, with the help of mysql dump client program, we are taking the backup of two databases named ‘tutorials’ and ‘query1’ in a file named ‘tutorials_query1.sql’. The following command will do this −C:\mysql\bin>mysqldump -u root --databases tutorials query1 > tutorials_query1.sqlThe above command will create a file named tutorials_query1.sql which have the dump information of both the databases named tutorials and query1.Read More

Restore a File Created by mysqldump

Sreemaha
Updated on 20-Jun-2020 10:39:45

187 Views

Suppose if we want to restore a file that has been created by mysqldump then we can restore in an existing database or in a new database after creating it. Then with the help of SOURCE statement, we can restore it. We can illustrate it by an example:ExampleIn this example, we are restoring the table named student_info.sql which has been dumped. It was basically in the database name ‘query’. Now we will restore it into a database named ‘tutorials’.mysql> Use Tutorials; Database changed mysql> SOURCE student_info.sql; Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected ... Read More

Define a Single-Dimensional Array in C#

karthikeya Boyini
Updated on 20-Jun-2020 10:39:26

308 Views

An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type stored at contiguous memory locations.To define a single-dimensional array −int[] runs = new int[10];Let us now initialize the array in the same line −int[] runs = new int[5] {125, 173, 190, 264, 188};The following is an example displaying how to declare, initialize and display an array −Example Live Demousing System; namespace Program {    class Demo {       static void Main(string[] args) {          int[] ... Read More

Advertisements