What are Class Instances in C#

Arjun Thakur
Updated on 20-Jun-2020 12:45:18

5K+ Views

Class instances are objects. Like any other object-oriented language, C# also has object and classes. Objest are real-world entities and instance of a class. Access the members of the class using an object.To access the class members, you use the dot (.) operator after the object name. The dot operator links the name of an object with the name of a member for example, Box Box1 = new Box();Above you can see Box1 is our object. We will use it to access the members −Box1.height = 7.0;You can also use it to call member functions −Box1.getVolume();The following is an example ... Read More

MySQL Function to Find First Non-NULL Value

Ayyan
Updated on 20-Jun-2020 12:02:11

247 Views

We can use MySQL COALESCE() function to get the first non-NULL value as output from a list of values. In other words, this function will check all the values until non-null value found. It can take one or more than one argument. It is having the following syntax:COALESCE(value1, value2, …, valueN)ExampleFollowing is an example to demonstrate it −mysql> Select COALESCE(NULL, NULL, NULL, 'Ram', 'Aarav', NULL); +--------------------------------------------------+ | COALESCE(NULL, NULL, NULL, 'Ram', 'Aarav', NULL) | +--------------------------------------------------+ | Ram                                              | +--------------------------------------------------+ 1 row in set (0.00 sec)

What MySQL Returns for Empty Hexadecimal to Number Conversion

Rishi Raj
Updated on 20-Jun-2020 12:01:04

120 Views

As we know that an empty hexadecimal value is a zero-length binary string hence if 0 is added to it then the result would be 0. In other words, we can say that if we convert an empty hexadecimal value to a number then it produces 0. The following query will make it understand −mysql> SELECT X''+ 0; +--------+ | X''+ 0 | +--------+ | 0      | +--------+ 1 row in set (0.15 sec)

How MySQL Evaluates an Empty Hexadecimal Value

Arjun Thakur
Updated on 20-Jun-2020 11:58:42

267 Views

Actually, MySQL evaluates an empty hexadecimal value to a zero-length binary string. It can be demonstrated as follows −mysql> Select CHARSET(X''); +--------------+ | CHARSET(X'') | +--------------+ | binary       | +--------------+ 1 row in set (0.00 sec)The above result set shows that the empty hexadecimal value is a binary string. And the result set below shows that it is of length 0.mysql> Select LENGTH(X''); +-------------+ | LENGTH(X'') | +-------------+ | 0           | +-------------+ 1 row in set (0.00 sec)

MySQL UNHEX Function with Non-Hexadecimal Argument

Alankritha Ammu
Updated on 20-Jun-2020 11:58:11

193 Views

MySQL returns NULL if we provide any non-hexadecimal number as an argument to UNHEX() function. Following example will demonstrate it.Examplemysql> Select UNHEX('ANK96598'); +-------------------+ | UNHEX('ANK96598') | +-------------------+ | NULL              | +-------------------+ 1 row in set (0.00 sec)As we know that the valid hexadecimal digits are between ‘0…9’, ‘A…F’ or ‘a…f’ hence the above query returns NULL.

What are the Comments in C#

Arjun Thakur
Updated on 20-Jun-2020 11:57:09

182 Views

Comments are used for explaining code. Compilers ignore the comment entries. The multiline comments in C# programs start with /* and terminates with the characters */ as shown below.Multi-line comments/* The following is a mult-line comment In C# /*The /*...*/ is ignored by the compiler and it is put to add comments in the program.Single line comments// variable int a = 10;The following is a sample C# program showing how to add single-line as well as multi-line comments −Example Live Demousing System; namespace Demo {    class Program {       static void Main(string[] args) {       ... Read More

How MySQL Prevents Unauthorized Clients from Accessing the Database System

Abhinaya
Updated on 20-Jun-2020 11:51:30

250 Views

MySQL implements a sophisticated access control and privilege system that allows us to create comprehensive access rules for handling client operations and effectively preventing unauthorized clients from accessing the database system.The MySQL access control has two stages when a client connects to the server −Connection verification A client, which connects to the MySQL database server, needs to have a valid username and password. In addition, the host from that the client connects needs to match with the host within the MySQL grant table.Request verificationonce a connection is established successfully, for each statement issued by the client, MySQL checks whether the client ... Read More

What are Constructors in C# Programs

Samual Sam
Updated on 20-Jun-2020 11:51:03

621 Views

A class constructor is a special member function of a class that is executed whenever we create new objects of that class.A constructor has exactly the same name as that of class and it does not have any return type.Constructor has the same name as the class name −class Demo {    public Demo() {} }The following is an example −Example Live Demousing System; namespace LineApplication {    class Line {       private double length; // Length of a line       public Line() {          Console.WriteLine("Object is being created");     ... Read More

Tables to Control Privileges in MySQL Database Server

radhakrishna
Updated on 20-Jun-2020 11:50:56

273 Views

When we install MySQL server, a database named MySQL created automatically. This MySQL database contains five main grant tables with the help of which MySQL server can control the privileges of MySQL database server. These tables are as follows −user tableThis table contains user account and global privileges columns. MySQL uses the user table to either accept or reject a connection from a host. A privilege granted in the user table is effective to all databases on the MySQL server.db tableThis table contains database-level privileges. MySQL uses the db table to determine which database a user can access and from which host. ... Read More

Contextual Keywords in C#

Chandu yadav
Updated on 20-Jun-2020 11:50:16

742 Views

In C#, some identifiers have special meaning in context of code, such as get and set are called contextual keywords.The following is the table showing contextual keywords −Contextual Keywordsaddaliasascendingdescendingdynamicfromgetglobalgroupintojoinletorderbypartial (type)partial(method)removeselectset

Advertisements