Here is the article with all the details: PHP Programming with Visual Studio Code
Programming Tips and Tricks - Daily coding tips and tricks regarding C#, .NET, ASP.NET, SQL
Thursday, 29 November 2018
PHP Programming with Visual Studio Code
Here is the article with all the details: PHP Programming with Visual Studio Code
Saturday, 24 November 2018
What is AngularJS and Angular ?
AngularJS is an open-source, JavaScript-based, front-end web application framework for dynamic web app development. ... Although Angular 2 was a complete rewrite of AngularJS
AngularJS is dying, but not Angular. Even three years after they announced Angular, the naming of the frameworks is cause for confusion. So yes, AngularJS is dying. As soon as Google announced that Angular was going to be a complete re-write, with no backwards compatibility, AngularJS began to die.
Starting with Angular ? So do you know Angular CLI ?
Angular now has its own CLI (command line interface), which will do most of the routine operations for you. To start using Angular, we have to install it.
It requires Node 6.9.0 or higher as well as NPM 3 or higher.
Once they are both installed, we are going to install Angular CLI by running the following:
npm install -g @angular/cli
Staring with Angular ? So do you know TypeScript ?
If you don't have any idea about typescript then don't have worry about that. Your javascript knowledge is enough to learn that.
TypeScript is a typed super set of JavaScript which has been built and maintained by Microsoft and chosen by the AngularJS team for development.
It has (.ts) extension.
Starting with Angular
Angular is a new version of the AngularJS framework, developed by Google. It comes with a complete rewrite, and various improvements including optimized builds and faster compile times.
Angular is a fully integrated framework that allows you to start working on your project quickly without thinking about which libraries to select and how to deal with everyday problems. I think of Angular as being for the front-end, as RoR is for the back-end.
Find the user who dropped database table
First, let us drop the table by following command.
DROP TABLE TempTable
GO
Now the challenge is how to find out who dropped the table which was created in the database.
There is a simpler way to do the same.
Right click on the database then Go to Reports -> Standard Reports -> Schema Changes History.
Once you open Schema Changes History, you will see a report. Over there, expand any object which you are interested in and you will see necessary details associated with the same.
For ex., I am interested in TempTable and you can see it shows the three rows of schema change. You can also see the name of the user and time when he/she dropped the table.
Wednesday, 21 November 2018
What is delegates in c#?
Delegates are especially used for implementing events and the call-back methods. All delegates are implicitly derived from the System.Delegate class.
A delegate can be declared using delegate keyword followed by a function signature as shown below.
<access modifier> delegate < return type> <delegate_name>(<parameters>)
The following example declares a Print delegate.
public delegate void Print(int value)
Instantiating Delegates
Once a delegate type is declared, a delegate object must be created with the new keyword and be associated with a particular method. When creating a delegate, the argument passed to the new expression is written similar to a method call, but without the arguments to the method.
Example:
class Program { // declare delegate public delegate void Print(int value); static void Main(string[] args) { // Print delegate points to PrintNumber Print printDel = PrintNumber; printDel(100000); printDel(200); // Print delegate points to PrintMoney printDel = PrintMoney; printDel(10000); printDel(200); } public static void PrintNumber(int num) { Console.WriteLine("Number: {0,-12:N0}",num); } public static void PrintMoney(int money) { Console.WriteLine("Money: {0:C}", money); } }
Output:
Number: 10,000 Number: 200 Money: $ 10,000.00 Money: $ 200.00Here, we have declared Print delegate that accepts int type parameter and returns void. In the Main() method, a variable of Print type is declared and assigned a PrintNumber method name. Now, invoking Print delegate will in-turn invoke PrintNumber method. In the same way, if the Print delegate variable is assigned to the PrintMoney method, then it will invoke the PrintMoney method.