Dropping Constraint in SQL

We have seen in previous tutorials how to add constraints like FOREIGN KEY and DEFAULT.  But in case, you no longer need them, then you can easily drop them using DROP CONSTRAINT statement.  The syntax for dropping a constraint is given below. ALTER TABLE {Table_Name} DROP CONSTRAINT {Constraint_Name}

Default Constraint in SQL

As we have seen in previous tutorial that we can have non-nullable columns in SQL by using NOT NULL constraint.  But if we would not use NOT NULL constraint and insert values in all other columns except to a nullable column, then that column will have null value by default in it.  To overcome this

Attribute in C# with Example

Attributes in DotNet are basically used to add declarative information to classes, properties, methods etc.  This declarative information can be retrieved using reflection at runtime.  An attribute is nothing more than a class which directly or indirectly inherits from Attribute class.  There are a lot of predefined attributes in DotNet framework.  However, you can also

Increment & Decrement Operators in PHP

Increment and decrement operators in PHP increment and decrement value by 1.  There are 4 types of increment and decrement operators. Pre-Increment:  ++$variable Post-Increment:  $variable++ Pre-Decrement:  –$variable Post-Decrement:  $variable– Example for increment and decrement operators is given below. <?php $pre_increment = 10; $post_increment = 10; $pre_decrement = 10; $post_decrement = 10; //Pre-Increment: 11 echo 'Pre-Increment:

How to Get File Name from Path in C#/CSharp

To get file name from path in C#/CSharp, we make use of GetFileName() static method of Path class, which resides in System.IO namespace.  Example is given below. using System; using System.IO; namespace Hello_World { class Program { static void Main(string args) { string file = @"C:\Users\ADMIN\Desktop\delete.txt"; string name = Path.GetFileName(file); Console.WriteLine(name); } } }