Home
Videos uploaded by user “kudvenkat”
Part 36 - C# Tutorial - Delegates in c#.avi
 
11:54
In this c sharp tutorial we will learn the basics of delegates Text version of the video http://csharp-video-tutorials.blogspot.com/2012/06/part-36-c-tutorial-delegates.html Slides http://csharp-video-tutorials.blogspot.com/2013/08/part-36-delegates.html All C# Text Articles http://csharp-video-tutorials.blogspot.co.uk/p/free-c-video-tutorial-for-beginners.html All C# Slides http://csharp-video-tutorials.blogspot.com/p/c.html Complete C# tutorial https://www.youtube.com/playlist?list=PLAC325451207E3105 All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 436256 kudvenkat
Part 4   Delete duplicate rows in sql
 
03:26
Link for all dot net and sql server video tutorial playlists http://www.youtube.com/user/kudvenkat/playlists Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2014/05/part-4-delete-duplicate-rows-in-sql.html In this video, we will discuss deleting all duplicate rows except one from a sql server table. SQL Script to create Employees table Create table Employees ( ID int, FirstName nvarchar(50), LastName nvarchar(50), Gender nvarchar(50), Salary int ) GO Insert into Employees values (1, 'Mark', 'Hastings', 'Male', 60000) Insert into Employees values (1, 'Mark', 'Hastings', 'Male', 60000) Insert into Employees values (1, 'Mark', 'Hastings', 'Male', 60000) Insert into Employees values (2, 'Mary', 'Lambeth', 'Female', 30000) Insert into Employees values (2, 'Mary', 'Lambeth', 'Female', 30000) Insert into Employees values (3, 'Ben', 'Hoskins', 'Male', 70000) Insert into Employees values (3, 'Ben', 'Hoskins', 'Male', 70000) Insert into Employees values (3, 'Ben', 'Hoskins', 'Male', 70000) The delete query should delete all duplicate rows except one. Here is the SQL query that does the job. PARTITION BY divides the query result set into partitions. WITH EmployeesCTE AS ( SELECT *, ROW_NUMBER()OVER(PARTITION BY ID ORDER BY ID) AS RowNumber FROM Employees ) DELETE FROM EmployeesCTE WHERE RowNumber ] 1
Views: 382676 kudvenkat
Indexes in sql server   Part 35
 
11:14
In this video we will learn about What are indexes Why do we use indexes Advantages of indexes These concepts are applicable to sql server 2000, 2005 and 2008 Text version of the video http://csharp-video-tutorials.blogspot.com/2012/09/indexes-in-sql-server-part-35.html Slides http://csharp-video-tutorials.blogspot.com/2013/08/part-35-indexes.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 432286 kudvenkat
Part 32 - C# Tutorial - Abstract classes in c#.avi
 
09:50
In this part of the c sharp tutorial we will learn about abstract classes Text version of the video http://csharp-video-tutorials.blogspot.com/2012/06/part-32-c-tutorial-abstract-classes.html Slides http://csharp-video-tutorials.blogspot.com/2013/08/part-32-abstract-classes.html All C# Text Articles http://csharp-video-tutorials.blogspot.co.uk/p/free-c-video-tutorial-for-beginners.html All C# Slides http://csharp-video-tutorials.blogspot.com/p/c.html Complete C# tutorial https://www.youtube.com/playlist?list=PLAC325451207E3105 All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 310619 kudvenkat
Over clause in SQL Server
 
09:13
over partition by in sql server 2008 sql server over clause partition partition by clause in sql server 2008 over partition by clause in sql In this video we will discuss the power and use of Over clause in SQL Server. The OVER clause combined with PARTITION BY is used to break up data into partitions. Syntax : function (...) OVER (PARTITION BY col1, Col2, ...) The specified function operates for each partition. For example : COUNT(Gender) OVER (PARTITION BY Gender) will partition the data by GENDER i.e there will 2 partitions (Male and Female) and then the COUNT() function is applied over each partition. Any of the following functions can be used. Please note this is not the complete list. COUNT(), AVG(), SUM(), MIN(), MAX(), ROW_NUMBER(), RANK(), DENSE_RANK() etc. Example : SQl Script to create Employees table Create Table Employees ( Id int primary key, Name nvarchar(50), Gender nvarchar(10), Salary int ) Go Insert Into Employees Values (1, 'Mark', 'Male', 5000) Insert Into Employees Values (2, 'John', 'Male', 4500) Insert Into Employees Values (3, 'Pam', 'Female', 5500) Insert Into Employees Values (4, 'Sara', 'Female', 4000) Insert Into Employees Values (5, 'Todd', 'Male', 3500) Insert Into Employees Values (6, 'Mary', 'Female', 5000) Insert Into Employees Values (7, 'Ben', 'Male', 6500) Insert Into Employees Values (8, 'Jodi', 'Female', 7000) Insert Into Employees Values (9, 'Tom', 'Male', 5500) Insert Into Employees Values (10, 'Ron', 'Male', 5000) Go Write a query to retrieve total count of employees by Gender. Also in the result we want Average, Minimum and Maximum salary by Gender. This can be very easily achieved using a simple GROUP BY query as show below. SELECT Gender, COUNT(*) AS GenderTotal, AVG(Salary) AS AvgSal, MIN(Salary) AS MinSal, MAX(Salary) AS MaxSal FROM Employees GROUP BY Gender What if we want non-aggregated values (like employee Name and Salary) in result set along with aggregated values You cannot include non-aggregated columns in the GROUP BY query. SELECT Name, Salary, Gender, COUNT(*) AS GenderTotal, AVG(Salary) AS AvgSal, MIN(Salary) AS MinSal, MAX(Salary) AS MaxSal FROM Employees GROUP BY Gender The above query will result in the following error : Column 'Employees.Name' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause One way to achieve this is by including the aggregations in a subquery and then JOINING it with the main query as shown in the example below. Look at the amount of T-SQL code we have to write. SELECT Name, Salary, Employees.Gender, Genders.GenderTotals, Genders.AvgSal, Genders.MinSal, Genders.MaxSal FROM Employees INNER JOIN (SELECT Gender, COUNT(*) AS GenderTotals, AVG(Salary) AS AvgSal, MIN(Salary) AS MinSal, MAX(Salary) AS MaxSal FROM Employees GROUP BY Gender) AS Genders ON Genders.Gender = Employees.Gender Better way of doing this is by using the OVER clause combined with PARTITION BY SELECT Name, Salary, Gender, COUNT(Gender) OVER(PARTITION BY Gender) AS GenderTotals, AVG(Salary) OVER(PARTITION BY Gender) AS AvgSal, MIN(Salary) OVER(PARTITION BY Gender) AS MinSal, MAX(Salary) OVER(PARTITION BY Gender) AS MaxSal FROM Employees Text version of the video http://csharp-video-tutorials.blogspot.com/2015/09/over-clause-in-sql-server.html Slides http://csharp-video-tutorials.blogspot.com/2015/09/over-clause-in-sql-server_29.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 100185 kudvenkat
Part 24 - C# Tutorial - Difference between method overriding and method hiding.avi
 
06:48
Text version of the video http://csharp-video-tutorials.blogspot.com/2012/06/part-24-c-tutorial-difference-between.html Slides http://csharp-video-tutorials.blogspot.com/2013/08/part-24-method-overriding-vs-method.html All C# Text Articles http://csharp-video-tutorials.blogspot.co.uk/p/free-c-video-tutorial-for-beginners.html All C# Slides http://csharp-video-tutorials.blogspot.com/p/c.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists In this part of the c sharp tutorial we will learn the difference between method overriding and method hiding
Views: 282736 kudvenkat
FIRST VALUE function in SQL Server
 
02:48
In this video we will discuss FIRST_VALUE function in SQL Server FIRST_VALUE function Introduced in SQL Server 2012 Retrieves the first value from the specified column ORDER BY clause is required PARTITION BY clause is optional Syntax : FIRST_VALUE(Column_Name) OVER (ORDER BY Col1, Col2, ...) FIRST_VALUE function example WITHOUT partitions : In the following example, FIRST_VALUE function returns the name of the lowest paid employee from the entire table. SELECT Name, Gender, Salary, FIRST_VALUE(Name) OVER (ORDER BY Salary) AS FirstValue FROM Employees FIRST_VALUE function example WITH partitions : In the following example, FIRST_VALUE function returns the name of the lowest paid employee from the respective partition. SELECT Name, Gender, Salary, FIRST_VALUE(Name) OVER (PARTITION BY Gender ORDER BY Salary) AS FirstValue FROM Employees Text version of the video http://csharp-video-tutorials.blogspot.com/2015/10/firstvalue-function-in-sql-server.html Slides http://csharp-video-tutorials.blogspot.com/2015/10/firstvalue-function-in-sql-server_6.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 37886 kudvenkat
Part 48   C# Tutorial   Difference between Types and Type Members
 
05:49
Tags c# endregion name c# region example #endregion directive expected c# asp.net region c# c# collapsible region #region c# syntax c# expand collapse code what are types in c# type members in c# c# type access modifiers visual studio code regions In this video we will discuss The difference between Types and Type Members Organising code with regions Text version of the video http://csharp-video-tutorials.blogspot.com/2012/07/part-48-c-tutorial-difference-between.html Slides http://csharp-video-tutorials.blogspot.com/2013/08/part-48-difference-between-types-and.html All C# Text Articles http://csharp-video-tutorials.blogspot.co.uk/p/free-c-video-tutorial-for-beginners.html All C# Slides http://csharp-video-tutorials.blogspot.com/p/c.html Complete C# tutorial https://www.youtube.com/playlist?list=PLAC325451207E3105 All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 113323 kudvenkat
Lead and Lag functions in SQL Server 2012
 
07:27
In this video we will discuss about Lead and Lag functions. Lead and Lag functions Introduced in SQL Server 2012 Lead function is used to access subsequent row data along with current row data Lag function is used to access previous row data along with current row data ORDER BY clause is required PARTITION BY clause is optional Syntax LEAD(Column_Name, Offset, Default_Value) OVER (ORDER BY Col1, Col2, ...) LAG(Column_Name, Offset, Default_Value) OVER (ORDER BY Col1, Col2, ...) Offset - Number of rows to lead or lag. Default_Value - The default value to return if the number of rows to lead or lag goes beyond first row or last row in a table or partition. If default value is not specified NULL is returned. We will use the following Employees table for the examples in this video SQL Script to create the Employees table Create Table Employees ( Id int primary key, Name nvarchar(50), Gender nvarchar(10), Salary int ) Go Insert Into Employees Values (1, 'Mark', 'Male', 1000) Insert Into Employees Values (2, 'John', 'Male', 2000) Insert Into Employees Values (3, 'Pam', 'Female', 3000) Insert Into Employees Values (4, 'Sara', 'Female', 4000) Insert Into Employees Values (5, 'Todd', 'Male', 5000) Insert Into Employees Values (6, 'Mary', 'Female', 6000) Insert Into Employees Values (7, 'Ben', 'Male', 7000) Insert Into Employees Values (8, 'Jodi', 'Female', 8000) Insert Into Employees Values (9, 'Tom', 'Male', 9000) Insert Into Employees Values (10, 'Ron', 'Male', 9500) Go Lead and Lag functions example WITHOUT partitions : This example Leads 2 rows and Lags 1 row from the current row. When you are on the first row, LEAD(Salary, 2, -1) allows you to move forward 2 rows and retrieve the salary from the 3rd row. When you are on the first row, LAG(Salary, 1, -1) allows us to move backward 1 row. Since there no rows beyond row 1, Lag function in this case returns the default value -1. When you are on the last row, LEAD(Salary, 2, -1) allows you to move forward 2 rows. Since there no rows beyond the last row 1, Lead function in this case returns the default value -1. When you are on the last row, LAG(Salary, 1, -1) allows us to move backward 1 row and retrieve the salary from the previous row. SELECT Name, Gender, Salary, LEAD(Salary, 2, -1) OVER (ORDER BY Salary) AS Lead_2, LAG(Salary, 1, -1) OVER (ORDER BY Salary) AS Lag_1 FROM Employees Lead and Lag functions example WITH partitions : Notice that in this example, Lead and Lag functions return default value if the number of rows to lead or lag goes beyond first row or last row in the partition. SELECT Name, Gender, Salary, LEAD(Salary, 2, -1) OVER (PARTITION By Gender ORDER BY Salary) AS Lead_2, LAG(Salary, 1, -1) OVER (PARTITION By Gender ORDER BY Salary) AS Lag_1 FROM Employees Text version of the video http://csharp-video-tutorials.blogspot.com/2015/10/lead-and-lag-functions-in-sql-server.html Slides http://csharp-video-tutorials.blogspot.com/2015/10/lead-and-lag-functions-in-sql-server_5.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 57674 kudvenkat
Clustered and nonclustered indexes in sql server   Part 36
 
16:49
In this video we will learn about 1. Different types of indexes in sql server 2. What are clustered indexes 3. What are NonClustered indexes 4. Difference between clustered and non clustered indexes Text version of the video http://csharp-video-tutorials.blogspot.co.uk/2012/09/clustered-and-non-clustered-indexes.html Slides http://csharp-video-tutorials.blogspot.com/2013/09/part-36-clustered-nonclustered-indexes.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 521432 kudvenkat
Database normalization   Part 52
 
12:11
In this video we will learn about, database normalization, different normal forms, problems of data redundancy, first normal form, that is how to put a table in 1 NF. Text version of the video http://csharp-video-tutorials.blogspot.com/2012/09/database-normalization-part-52.html Slides http://csharp-video-tutorials.blogspot.com/2013/09/part-52-normalization.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 200680 kudvenkat
Part 1   Introduction to WCF
 
10:09
Link for code samples used in the demo http://csharp-video-tutorials.blogspot.com/2013/11/part-1-introduction-to-wcf.html Link for all dot net and sql server video tutorial playlists http://www.youtube.com/user/kudvenkat/playlists In this video we will discuss What is WCF Why should we use WCF What is WCF? WCF stands for Windows Communication Foundation and is part of .NET 3.0. WCF is Microsoft platform for building distributed and interoperable applications. What is a distributed application? In simple terms a distributed application, is an application where parts of it run on 2 or more computers. Distributed applications are also called as connected systems or applications. Examples: A web application running on one machine and a web service that this application is consuming is running on another machine. An enterprise web application may have the following tiers, and each tier may be running on a different machine 1. Presentation tier 2. Business tier 3. Data Access tier Why build distributed applications? There are several reasons for this 1. An enterprise application may need to use the services provided by other enterprises. For example an ecommerce application may be using paypal service for payments. 2. For better scalability. An enterprise web application may have Presentation tier, Business tier, and Data Access tiert, and each tier may be running on a different machine. What is an interoperable application? An application that can communicate with any other application that is built on any platform and using any programming language is called as an interoperable application. Web services are interoperable, where as .NET remoting services are not. Web services can communicate with any application built on any platform, where as a .NET remoting service can be consumed only by a .net application. What technology choices did we have before WCF to build distributed applications? Enterprise Services Dot Net Remoting Web Services Why should we use WCF? Let's take this scenario We have 2 clients and we need to implement a service a for them. 1. The first client is using a Java application to interact with our service, so for interoperability this client wants messages to be in XML format and the protocol to be HTTP. 2. The second client uses .NET, so for better performance this client wants messages formmated in binary over TCP protocol. Without WCF 1. To satisfy the first client requirement we end up implementing an ASMX web service, and 2. To satisfy the second client requirement we end up implementing a remoting service These are 2 different technologies, and have complete different programming models. So the developers have to learn different technologies. So to unify and bring all these technologies under one roof Microsoft has come up with a single programming model that is called as WCF - Windows Communication Foundation. With WCF, You implement one service and we can configure as many end points as want to support all the client needs. To support the above 2 client requirements, we would configure 2 end points. In the endpoint configuration we can specify the protocols and message formats that we want to use. In Part 2, we will discuss implementing 1. A web service to exchange messages in XML format using HTTP protocol for interoperability. 2. A remoting service to exchange messages in binary format using TCP protocol for performance. Along the way, we will get a feel of how different these technologies are. In Part 3, we will dicuss implementing a single WCF Service and configuring different end points to support different transport protocols and message formats.
Views: 802547 kudvenkat
Difference between where and having in sql server
 
06:36
sql server where vs having sql server group by where having group by having sql server In this vide we will discuss the difference between where and having caluses in sql server. Let us understand the difference with an example. To calculate total sales by product, we would write a GROUP BY query as shown below SELECT Product, SUM(SaleAmount) AS TotalSales FROM Sales GROUP BY Product Now if we want to find only those products where the total sales amount is greater than $1000, we will use HAVING clause to filter products SELECT Product, SUM(SaleAmount) AS TotalSales FROM Sales GROUP BY Product HAVING SUM(SaleAmount) ] 1000 If we use WHERE clause instead of HAVING clause, we will get a syntax error. This is because the WHERE clause doesn’t work with aggregate functions like sum, min, max, avg, etc. SELECT Product, SUM(SaleAmount) AS TotalSales FROM Sales GROUP BY Product WHERE SUM(SaleAmount) ] 1000 So in short, the difference is WHERE clause cannot be used with aggregates where as HAVING can. However, there are other differences as well that we need to keep in mind when using WHERE and HAVING clauses. WHERE clause filters rows before aggregate calculations are performed where as HAVING clause filters rows after aggregate calculations are performed. Let us understand this with an example. Total sales of iPhone and Speakers can be calculated by using either WHERE or HAVING clause Calculate Total sales of iPhone and Speakers using WHERE clause : In this example the WHERE clause retrieves only iPhone and Speaker products and then performs the sum. SELECT Product, SUM(SaleAmount) AS TotalSales FROM Sales WHERE Product in ('iPhone', 'Speakers') GROUP BY Product Calculate Total sales of iPhone and Speakers using HAVING clause : This example retrieves all rows from Sales table, performs the sum and then removes all products except iPhone and Speakers. SELECT Product, SUM(SaleAmount) AS TotalSales FROM Sales GROUP BY Product HAVING Product in ('iPhone', 'Speakers') So from a performance standpoint, HAVING is slower than WHERE and should be avoided when possible. Another difference is WHERE comes before GROUP BY and HAVING comes after GROUP BY. Difference between WHERE and Having 1. WHERE clause cannot be used with aggregates where as HAVING can. This means WHERE clause is used for filtering individual rows where as HAVING clause is used to filter groups. 2. WHERE comes before GROUP BY. This means WHERE clause filters rows before aggregate calculations are performed. HAVING comes after GROUP BY. This means HAVING clause filters rows after aggregate calculations are performed. So from a performance standpoint, HAVING is slower than WHERE and should be avoided when possible. 3. WHERE and HAVING can be used together in a SELECT query. In this case WHERE clause is applied first to filter individual rows. The rows are then grouped and aggregate calculations are performed, and then the HAVING clause filters the groups. Text version of the video http://csharp-video-tutorials.blogspot.com/2015/09/difference-between-where-and-having-in.html Slides http://csharp-video-tutorials.blogspot.com/2015/09/difference-between-where-and-having-in_15.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html Full SQL Server Course https://www.youtube.com/playlist?list=PL4cyC4G0M1RQ_Rm52cQ4CcOJ_T_HXeMB4 All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 77832 kudvenkat
Part 69   Action filters in mvc
 
02:13
Link for code samples used in the demo http://csharp-video-tutorials.blogspot.com/2013/08/part-69-action-filters-in-mvc.html Link for csharp, asp.net, ado.net, dotnet basics, mvc and sql server video tutorial playlists http://www.youtube.com/user/kudvenkat/playlists What are action filters in asp.net mvc? Action filters are attributes that can be applied either on a controller action method or on a controller. When applied at the controller level, they are applicable for all actions within that controller. Action filters allow us to add, pre and post processing logic to an action method. This means, they allow us to modify the way in which an action is executed. Name a few action filters in mvc? Authorize ChildActionOnly HandleError OutputCache RequireHttps ValidateInput ValidateAntiForgeryToken We will discuss each of these action filters in detail in our upcoming videos. Can you create a custom action filter in mvc? Yes, we will discuss this in a later video session.
Views: 109289 kudvenkat
Part 3   Why and when should we use an abstract class
 
20:29
Link for code samples used in the demo http://csharp-video-tutorials.blogspot.com/2013/09/part-3-why-and-when-should-we-use.html Link for csharp, asp.net, ado.net, dotnet basics, mvc and sql server video tutorial playlists http://www.youtube.com/user/kudvenkat/playlists This question can also be asked in a slightly different way Give an example of where we could use an abstract class? Let us understand when to use an abstract class with an example. An organisation has 2 types of employees 1. FullTimeEmployee 2. ContractEmployee We would create an abstract class, when want to move the common functionality of 2 or more related classes into a base class and when, we don't want that base class to be instantiated.
Views: 599846 kudvenkat
Part 30 - C# Tutorial - Interfaces in c#.avi
 
20:34
In this part of the c sharp tutorial we will learn about interfaces Text version of the video http://csharp-video-tutorials.blogspot.com/2012/06/part-30-c-tutorial-interfaces-in-c.html Slides http://csharp-video-tutorials.blogspot.com/2013/08/part-30-introduction-to-interfaces.html All C# Text Articles http://csharp-video-tutorials.blogspot.co.uk/p/free-c-video-tutorial-for-beginners.html All C# Slides http://csharp-video-tutorials.blogspot.com/p/c.html Complete C# tutorial https://www.youtube.com/playlist?list=PLAC325451207E3105 All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 484735 kudvenkat
Rank and Dense Rank in SQL Server
 
10:08
rank and dense_rank example difference between rank and dense_rank with example rank vs dense_rank in sql server 2008 sql server difference between rank and dense_rank In this video we will discuss Rank and Dense_Rank functions in SQL Server Rank and Dense_Rank functions Introduced in SQL Server 2005 Returns a rank starting at 1 based on the ordering of rows imposed by the ORDER BY clause ORDER BY clause is required PARTITION BY clause is optional When the data is partitioned, rank is reset to 1 when the partition changes Difference between Rank and Dense_Rank functions Rank function skips ranking(s) if there is a tie where as Dense_Rank will not. For example : If you have 2 rows at rank 1 and you have 5 rows in total. RANK() returns - 1, 1, 3, 4, 5 DENSE_RANK returns - 1, 1, 2, 3, 4 Syntax : RANK() OVER (ORDER BY Col1, Col2, ...) DENSE_RANK() OVER (ORDER BY Col1, Col2, ...) RANK() and DENSE_RANK() functions without PARTITION BY clause : In this example, data is not partitioned, so RANK() function provides a consecutive numbering except when there is a tie. Rank 2 is skipped as there are 2 rows at rank 1. The third row gets rank 3. DENSE_RANK() on the other hand will not skip ranks if there is a tie. The first 2 rows get rank 1. Third row gets rank 2. SELECT Name, Salary, Gender, RANK() OVER (ORDER BY Salary DESC) AS [Rank], DENSE_RANK() OVER (ORDER BY Salary DESC) AS DenseRank FROM Employees RANK() and DENSE_RANK() functions with PARTITION BY clause : Notice when the partition changes from Female to Male Rank is reset to 1 SELECT Name, Salary, Gender, RANK() OVER (PARTITION BY Gender ORDER BY Salary DESC) AS [Rank], DENSE_RANK() OVER (PARTITION BY Gender ORDER BY Salary DESC) AS DenseRank FROM Employees Use case for RANK and DENSE_RANK functions : Both these functions can be used to find Nth highest salary. However, which function to use depends on what you want to do when there is a tie. Let me explain with an example. If there are 2 employees with the FIRST highest salary, there are 2 different business cases 1. If your business case is, not to produce any result for the SECOND highest salary, then use RANK function 2. If your business case is to return the next Salary after the tied rows as the SECOND highest Salary, then use DENSE_RANK function Since we have 2 Employees with the FIRST highest salary. Rank() function will not return any rows for the SECOND highest Salary. WITH Result AS ( SELECT Salary, RANK() OVER (ORDER BY Salary DESC) AS Salary_Rank FROM Employees ) SELECT TOP 1 Salary FROM Result WHERE Salary_Rank = 2 Though we have 2 Employees with the FIRST highest salary. Dense_Rank() function returns, the next Salary after the tied rows as the SECOND highest Salary WITH Result AS ( SELECT Salary, DENSE_RANK() OVER (ORDER BY Salary DESC) AS Salary_Rank FROM Employees ) SELECT TOP 1 Salary FROM Result WHERE Salary_Rank = 2 You can also use RANK and DENSE_RANK functions to find the Nth highest Salary among Male or Female employee groups. The following query finds the 3rd highest salary amount paid among the Female employees group WITH Result AS ( SELECT Salary, Gender, DENSE_RANK() OVER (PARTITION BY Gender ORDER BY Salary DESC) AS Salary_Rank FROM Employees ) SELECT TOP 1 Salary FROM Result WHERE Salary_Rank = 3 AND Gender = 'Female' Text version of the video http://csharp-video-tutorials.blogspot.com/2015/10/rank-and-denserank-in-sql-server.html Slides http://csharp-video-tutorials.blogspot.com/2015/10/rank-and-denserank-in-sql-server_1.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 88643 kudvenkat
C# abstract class virtual method
 
04:57
Text version of the video http://csharp-video-tutorials.blogspot.com/2016/10/c-abstract-class-virtual-method.html Slides http://csharp-video-tutorials.blogspot.com/2016/10/c-abstract-class-virtual-method_24.html All C# Interview Questions Text Articles & Slides http://csharp-video-tutorials.blogspot.com/p/c-interview-questions.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 72741 kudvenkat
What is bootstrap
 
06:28
twitter bootstrap tutorial for beginners twitter bootstrap for beginners benefits of bootstrap framework advantages of bootstrap framework twitter bootstrap benefits what is responsive web design what is responsive website what is responsive design use of bootstrap responsive web development responsive web app In this video we will discuss 1. What is bootstrap 2. Advantages of using bootstrap Bootstrap is a free, open-source and is the most popular HTML, CSS, and JavaScript framework developed by twitter for creating responsive web applications. It includes HTML and CSS based design templates for common user interface components like Buttons, Dropdowns, Typography, Tabs, Forms, Tables, Navigations, Alerts, Modals, Accordion, Carousel etc. along with optional JavaScript extensions. Bootstrap framework is based on open standards - HTML, CSS and JavaScript. This means bootstrap can be used with any server side technology and any platform. You can use it with any web application built with any server side technology like ASP.NET, JAVA, PHP etc. What are the advantages of using bootstrap Supports responsive design : One of the greatest advantages of using bootstrap is that it helps us create responsive web applications faster and easier. So the obvious question that comes to our mind is, what is a responsive web application? A responsive web application automatically adapts to different screen sizes (i.e desktop computers, laptops, tablets. mobile phones etc). A responsive application provides optimal viewing and interaction experience i.e easy reading and navigation with a minimum of resizing, panning, and scrolling across a wide range of devices. So you don't have to worry about your application not being compatible with multiple devices. The images at the following links shows how a responsive and non-responsive application looks like on a mobile device. http://www.webnersolutions.com/wp-content/uploads/2015/08/responsive-vs-non-responsive-web-design1.jpg At the following link is a live responsive application example. Notice as we resize the browser, the content automatically adpats to the screen size. http://bootstrapdocs.com/v3.0.3/docs/examples/jumbotron/ Saves lot of development time : One of the biggest advantages of using Bootstrap is that it saves lot of development time. Instead of writing code from the scratch, bootstrap offers ready made blocks of code that you can use and customize to suit your application requirements. There are also many websites out there that offer free and paid Bootstrap themes that saves even more development time. Consistency : Bootstrap was developed by Twitter to encourage consistency across thier internal tools by giving their developers a centralised development code. Since all the developers are working using a centralised code, the end result is consistent regardless of who’s working on the project and which web browser is being used. Customizable : If you are using only a few features of bootstrap, you can customize to download only those features using the following bootstrap customize page. http://getbootstrap.com/customize/ Support : As Bootstrap is the most popular framework, it has a very large community base and excellent documentation. Bootstrap's excellent documentation, examples and demos helps a developer learn bootstrap quickly even if you are new to it. If you ever run into an issue you will usually get help quickly and easily from the vast online community and web forums. In our next video we will discuss, downloading, setting up and understanding different bootstrap components. Please stay tuned. Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2016/05/what-is-bootstrap.html
Views: 610469 kudvenkat
Part 9   Call an abstract method from an abstract class constructor
 
03:38
Link for code samples used in the demo http://csharp-video-tutorials.blogspot.com/2013/10/part-9-call-abstract-method-from.html Link for csharp, asp.net, ado.net, dotnet basics, mvc and sql server video tutorial playlists http://www.youtube.com/user/kudvenkat/playlists Can you call an abstract method from an abstract class constructor? If so, what is the use of it? Yes, an abstract method can be called from an abstract class constructor. Here is an example. public class Program { public static void Main() { CorporateCustomer CC = new CorporateCustomer(); SavingsCustomer SC = new SavingsCustomer(); } } public abstract class Customer { protected Customer() { Print(); } public abstract void Print(); } public class CorporateCustomer : Customer { public override void Print() { Console.WriteLine("CorporateCustomer Print() method implementation called"); } } public class SavingsCustomer : Customer { public override void Print() { Console.WriteLine("SavingsCustomer Print() method implementation called"); } } An abstract method in an abstract class does not have any implementation, so what is the use of calling it from the abstract class constructor? If you want the abstract method to be invoked automatically whenever an instance of the class that is derived from the abstract class is created, then we would call it in the constructor of the abstract class.
Views: 94934 kudvenkat
sql server concurrent transactions
 
07:34
Text version of the video http://csharp-video-tutorials.blogspot.com/2015/08/sql-server-concurrent-transactions.html Slides http://csharp-video-tutorials.blogspot.com/2015/08/sql-server-concurrent-transactions_14.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists In this video we will discuss 1. What a transaction is 2. The problems that might arise when tarnsactions are run concurrently 3. The different transaction isolation levels provided by SQL Server to address concurrency side effects First let us understand what is a transaction A transaction is a group of commands that change the data stored in a database. A transaction, is treated as a single unit of work. A transaction ensures that, either all of the commands succeed, or none of them. If one of the commands in the transaction fails, all of the commands fail, and any data that was modified in the database is rolled back. In this way, transactions maintain the integrity of data in a database. Example : The following transaction ensures that both the UPDATE statements succeed or both of them fail if there is a problem with one UPDATE statement. -- Transfer $100 from Mark to Mary Account BEGIN TRY BEGIN TRANSACTION UPDATE Accounts SET Balance = Balance - 100 WHERE Id = 1 UPDATE Accounts SET Balance = Balance + 100 WHERE Id = 2 COMMIT TRANSACTION PRINT 'Transaction Committed' END TRY BEGIN CATCH ROLLBACK TRANSACTION PRINT 'Transaction Rolled back' END CATCH Databases are powerful systems and are potentially used by many users or applications at the same time. Allowing concurrent transactions is essential for performance but may introduce concurrency issues when two or more transactions are working with the same data at the same time. Some of the common concurrency problems Dirty Reads Lost Updates Nonrepeatable Reads Phantom Reads We will discuss what these problems are in detail with examples in our upcomning videos One way to solve all these concurrency problems is by allowing only one user to execute, only one transaction at any point in time. Imagine what could happen if you have a large database with several users who want to execute several transactions. All the transactions get queued and they may have to wait a long time before they could get a chance to execute their transactions. So you are getting poor performance and the whole purpose of having a powerful database system is defeated if you serialize access this way. At this point you might be thinking, for best performance let us allow all transactions to execute concurrently. The problem with this approach is that it may cause all sorts of concurrency problems (i.e Dirty Reads, Lost Updates, Nonrepeatable Reads, Phantom Reads) if two or more transactions work with the same data at the same time. SQL Server provides different transaction isolation levels, to balance concurrency problems and performance depending on our application needs. Read Uncommitted Read Committed Repeatable Read Snapshot Serializable The isolation level that you choose for your transaction, defines the degree to which one transaction must be isolated from resource or data modifications made by other transactions. Depending on the isolation level you have chosen you get varying degrees of performance and concurrency problems. The table here has the list of isoltaion levels along with concurrency side effects. Isolation Level Dirty Reads Lost Update Nonrepeatable Reads Phantom Reads Read Uncommitted Yes Yes Yes Yes Read Committed No Yes Yes Yes Repeatable Read No No No Yes Snapshot No No No No Serializable No No No No If you choose the lowest isolation level (i.e Read Uncommitted), it increases the number of concurrent transactions that can be executed at the same time, but the down side is you have all sorts of concurrency issues. On the other hand if you choose the highest isolation level (i.e Serializable), you will have no concurrency side effects, but the downside is that, this will reduce the number of concurrent transactions that can be executed at the same time if those transactions work with same data. In our upcoming videos we will discuss the concurrency problems in detail with examples
Views: 79326 kudvenkat
Part 10   What happens if finally block throws an exception
 
06:02
Link for code samples used in the demo http://csharp-video-tutorials.blogspot.com/2013/10/part-10-what-happens-if-finally-block.html Link for all dot net and sql server video tutorial playlists http://www.youtube.com/user/kudvenkat/playlists This question can also be asked in a slightly different way How to handle exceptions that occur in finally block The exception propagates up, and should be handled at a higher level. If the exception is not handled at the higher level, the application crashes. The "finally" block execution stops at the point where the exception is thrown. In the example below, notice that the "finally" block in "Hello()" method throws an exception. Hello() method is being called in the Main() method and we don't have any exception handling mechanism in place in the Main() method. So, the application crashes with the exception. public class Program { public static void Main() { Hello(); } public static void Hello() { try { // Some code } catch { // Some code } finally { Console.WriteLine("This line will be executed"); int result = Convert.ToInt32("TEN"); Console.WriteLine("This line will NOT be executed"); } } } On the other hand, if you include exception handling mechanism(try/catch) in the Main() method, then you will have the opportunity to handle the exception. public static void Main() { try { Hello(); } catch (Exception ex) { // Process and log the exception Console.WriteLine(ex.Message); } } Irrespective of whether there is an exception or not "finally" block is guaranteed to execute. 1. If the "finally" block is being executed after an exception has occurred in the try block, 2. and if that exception is not handled 3. and if the finally block throws an exception Then the original exception that occurred in the try block is lost. Here is an example: public class Program { public static void Main() { try { Hello(); } catch (Exception ex) { Console.WriteLine(ex.Message); } } public static void Hello() { try { // This exception will be lost throw new Exception("Exception in TRY block"); } finally { throw new Exception("Exception in FINALLY block"); } } }
Views: 112886 kudvenkat
html attribute vs dom property
 
05:08
Text version of the video http://csharp-video-tutorials.blogspot.com/2017/06/html-attribute-vs-dom-property.html Slides http://csharp-video-tutorials.blogspot.com/2017/06/html-attribute-vs-dom-property_20.html Angular 2 Tutorial playlist https://www.youtube.com/playlist?list=PL6n9fhu94yhWqGD8BuKuX-VTKqlNBj-m6 Angular 2 Text articles and slides http://csharp-video-tutorials.blogspot.com/2017/06/angular-2-tutorial-for-beginners_12.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists In this video we will discuss the difference between HTML attribute and DOM property. What is DOM DOM stands for Document Object Model. When a browser loads a web page, the browser creates a Document Object Model of that page. In simple terms you can think of the DOM as an application programming interface (API) for HTML, and we can use programming languages like JavaScript, or JavaScript frameworks like Angular to access and manipulate the HTML using their corresponding DOM objects. In other words DOM contains the HTML elements as objects, their properties, methods and events and it is a standard for accessing, modifying, adding or deleting HTML elements. In the previous 2 videos we discussed interpolation and property binding in Angular. Interpolation example [button disabled='{{isDisabled}}']Click Me[/button] Property binding example [button [disabled]='isDisabled']Click Me[/button] If you notice the above 2 examples, it looks like we are binding to the Button's disabled attribute. This is not true. We are actually binding to the disabled property of the button object. Angular data-binding is all about binding to DOM object properties and not HTML element attributes. What is the difference between HTML element attribute and DOM property Attributes are defined by HTML, where as properties are defined by the DOM. Attributes initialize DOM properties. Once the initialization complete, the attributes job is done. Property values can change, where as attribute values can't. Let's prove this point - Property values change, but the attribute values don't with an example. In the example below, we have set the value attribute of the input element to Tom. [input id='inputId' type='text' value='Tom'] At this point, run the web page and in the textbox you will see 'Tom' as the value. Launch the browser developer tools. On the 'Console' tab, use the getattribute() method and value property of the input element to get the attribute and property values. Notice at the moment both have the value 'Tom' Change the value in the textbox to Mary. Notice now, when we query for the attribute and property values, the attribute value is still Tom but the property value is Mary. So this proves the point - Property values change, where as attribute values don't. So it is important to keep in mind that, HTML attributes and the DOM properties are different things. Angular binding works with properties and events, and not attributes. The role of attributes is to initialize element properties and their job is done.
Views: 122912 kudvenkat
Union and union all in sql server   Part 17
 
12:41
In this video we will learn about the 1. Purpose of UNION and UNION ALL 2. Difference between UNION and UNION ALL 3. Difference between JOIN and UNION Text version of the video http://csharp-video-tutorials.blogspot.com/2012/08/union-and-union-all-in-sql-server-part.html Slides http://csharp-video-tutorials.blogspot.com/2013/08/part-17-union-and-union-all.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 284487 kudvenkat
Pivot in sql server 2008   Part 54
 
12:25
In this video we will learn about pivot operator. Pivot is a sql server operator that can be used to turn unique values from one column, into multiple columns in the output, there by effectively rotating a table. Text version of the video http://csharp-video-tutorials.blogspot.com/2012/10/pivot-operator-in-sql-server-part-54.html Slides http://csharp-video-tutorials.blogspot.com/2013/09/part-54-pivot-in-sql-server-2008.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 204643 kudvenkat
Prototype in JavaScript
 
05:16
Link for all dot net and sql server video tutorial playlists http://www.youtube.com/user/kudvenkat/playlists Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/02/prototype-in-javascript.html In this video we will discuss Prototype object in JavaScript. Let us understand it's use with an example. The following Employee constructor function constructs Employee object. function Employee(name) { this.name = name; } There are several ways to add a function to the Employee object. One way is as shown below. This works but the problem with this approach is that, if you create 100 employee objects there will be 100 copies of getName() function. We don't want to be creating copies of functions, instead we want all the objects to share the same function code. This can be achieved using JavaScript prototype object. function Employee(name) { this.name = name; this.getName = function () { return this.name; } } var e1 = new Employee("Mark"); var e2 = new Employee("Sara"); document.write("e1.name = " + e1.getName() + "[br/]"); document.write("e2.name = " + e2.getName() + "[br/]"); Output : e1.name = Mark e2.name = Sara In this example, getName() function is added just to e1 object, and not to e2 object. So e2.getName() would throw an undefined error. function Employee(name) { this.name = name; } var e1 = new Employee("Mark"); e1.getName = function () { return this.name; } var e2 = new Employee("Sara"); document.write("e1.name = " + e1.getName() + "[br/]"); document.write("e2.name = " + e2.getName() + "[br/]"); In the following example getName() function is added to the Employee object using the name of the constructor function. This would also result in undefined error. function Employee(name) { this.name = name; } Employee.getName = function () { return this.name; } var e1 = new Employee("Mark"); var e2 = new Employee("Sara"); document.write("e1.name = " + e1.getName() + "[br/]"); document.write("e2.name = " + e2.getName() + "[br/]"); Using the prototype object to add functions : The following are the advantages of using the prototype object to add functions. 1. No matter how many objects you create, functions are loaded only once into memory 2. Allows you to override functions if required. function Employee(name) { this.name = name; } Employee.prototype.getName = function () { return this.name; } var e1 = new Employee("Mark"); var e2 = new Employee("Sara"); document.write("e1.name = " + e1.getName() + "[br/]"); document.write("e2.name = " + e2.getName() + "[br/]"); Output : e1.name = Mark e2.name = Sara
Views: 85196 kudvenkat
Group by in sql server - Part 11
 
17:44
In this video we will learn 1. Grouping rows using GROUP BY 2. Filtering Groups 3. Difference between WHERE and HAVING clause in sql server Text version of the video http://csharp-video-tutorials.blogspot.com/2012/08/group-by-part-11.html Slides http://csharp-video-tutorials.blogspot.com/2013/08/part-11-group-by.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 472686 kudvenkat
Difference between AngularJS, Angular 2 and Angular 4
 
08:01
Text version of the video http://csharp-video-tutorials.blogspot.com/2017/09/difference-between-angularjs-angular-2.html Slides http://csharp-video-tutorials.blogspot.com/2017/09/difference-between-angularjs-angular-2_13.html Angular 2 Tutorial playlist https://www.youtube.com/playlist?list=PL6n9fhu94yhWqGD8BuKuX-VTKqlNBj-m6 Angular 2 Text articles and slides http://csharp-video-tutorials.blogspot.com/2017/06/angular-2-tutorial-for-beginners_12.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists So far Google has released 3 versions of Angular Version Year ------------ ------ AngularJS 2010 Angular 2 2016 Angular 4 2017 What is the difference between AngularJS and Angular 2 The first version of Angular is called AngularJS and was released in the year 2010. Some people call it Angular 1, but it is officially called AngularJS. Angular 2 is released in the year 2016. The most important thing to keep in mind is that, Angular 2 is not a simple upgrade from angular 1. Angular 2 is completely rewritten from the ground up and as a result the way we write applications with AngularJS and Angular 2 is very different. From a performance standpoint, Angular 2 is 5 times faster compared to AngularJS. AngularJS was not built for mobile devices, where as Angular 2 on the other hand is designed from the ground up with mobile support in mind. With Angular 2 we have more language choices. In additon to nativa JavaScript we can use TypeScript, Dart, PureScript, Elm, etc. Angular 4 is released in 2017. So, What is the difference between Angular 2 and Angular 4 If you have worked with both Angular 1 and Angular 2, then you already know that the API's and patterns that we use to build applications are very different between these 2 versions. From a developer stand point, it is like learning 2 different frameworks. Since Angular 2 is a complete rewrite from Angular 1, moving from Angular 1 to Angular 2 is a total breaking change. However, changing from Angular 2 to Angular 4 and even future versions of Angular, won’t be like changing from Angular 1. It won’t be a complete rewrite, it will simply be a change in some core libraries. From a developer standpoint, building an application using Angular 2 and Angular 4 is not very different. We still use the same concepts and patterns. Angular 4 is simply, the next version of Angular 2. The underlying concepts are still the same and if you have already learnt Angular 2 then you’re well prepared to switch to Angular 4. The most important point to keep in mind is, Angular 4 is backwards compatible with Angular 2 for most applications. What has changed and what is new in Angular 4 Some under the hood changes to reduce the size of the AOT (Ahead-of-Time) compiler generated code. Migrating to Angular 4 may reduce the production bundles by hundreds of kilobytes. As a developer this change will not affect the way we write angular applications in any way. TypeScript 2.1 and 2.2 compatibility. Angular is updated with a more recent version of TypeScript, for better type checking throughout our application. Up until Angular 4, only TypeScript 1.8 was supported. With Angular 4, we can use typescript 2.1 or 2.2 which means we can use all the new features of TypeScript with Angular 4. Animation features are pulled out of @angular/core and are moved into their own package. This means that if you don’t use animations, this extra code will not end up in your production bundles. On the other hand, if you do have animations in your application, you may have to change your existing code to pull the animation features from the animations package. We can now use an if/else style syntax with *ngIf structural directive. In Angular 2, to implement if/else logic, we use 2 *ngIf structural directives. With Angular 4, we can use it's new if/else style syntax with *ngIf structural directive. We will discuss an example of this in our upcoming videos. What happened to Angular 3. Why did we move straight from Angular 2 to Angular 4. What is the reason for skipping Angular 3. Except the Router library, all the other Angular core libraries are versioned the same way and are shipped as NPM packages as you can see below. While all the other core angular packages are at Version 2, the router library is already at Version 3. Due to this misalignment of the router package’s version, the angular team decided to go straight for Angular v4. This way, all the core packages are aligned which will be easier to maintain and help avoid confusion in the future. Common Questions Do I have to learn AngularJS 1 before learning Angular 2 Do I have to learn Angular 2 before learning Angular 4
Views: 96603 kudvenkat
Transactions in sql server and ACID Tests   Part 58
 
09:50
In this video we will learn about Transaction ACID tests. A successful transaction must pass the "ACID" test, that is a transaction must be Atomic, Consistent, Isolated and Durable. Text version of the video http://csharp-video-tutorials.blogspot.com/2012/10/transaction-acid-tests-part-58.html Slides http://csharp-video-tutorials.blogspot.com/2013/09/part-58-transaction-acid-test.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 120580 kudvenkat
Async and await in C# example
 
11:56
In this video we will discuss async and await keywords and their use with an example. Text version of the video http://csharp-video-tutorials.blogspot.com/2016/10/async-and-await-in-c-example.html Slides http://csharp-video-tutorials.blogspot.com/2016/10/async-and-await-in-c-example_31.html All C# Text Articles http://csharp-video-tutorials.blogspot.com/p/free-c-video-tutorial-for-beginners.html All C# Slides http://csharp-video-tutorials.blogspot.com/p/c.html All C# Videos https://www.youtube.com/playlist?list=PLAC325451207E3105 All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 232692 kudvenkat
Lazy loading in angular
 
10:48
In this video we will discuss lazy loading angular modules Text version of the video https://csharp-video-tutorials.blogspot.com/2018/12/lazy-loading-in-angular.html Slides https://csharp-video-tutorials.blogspot.com/2018/12/lazy-loading-in-angular-slides.html Angular 6 Tutorial https://www.youtube.com/playlist?list=PL6n9fhu94yhWNJaDgh0mfae_9xoQ4E_Zj Angular 6 Tutorial Text Articles & Slides http://csharp-video-tutorials.blogspot.com/2018/09/angular-6-tutorial-for-beginners.html Angular, JavaScript, jQuery, Dot Net & SQL Playlists https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd
Views: 28485 kudvenkat
Indexed views in sql server   Part 41
 
13:40
In this video we will learn about, creating indexed views. A unique clustered index, is the first index that should be created on a view. Indexed views are also called as materialized views Text version of the video http://csharp-video-tutorials.blogspot.com/2012/09/indexed-views-in-sql-server-part-41.html Slides http://csharp-video-tutorials.blogspot.com/2013/09/part-41-indexed-views.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 168750 kudvenkat
Part 1   How to find nth highest salary in sql
 
11:45
Link for all dot net and sql server video tutorial playlists http://www.youtube.com/user/kudvenkat/playlists Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2014/05/part-1-how-to-find-nth-highest-salary_17.html This is a very common SQL Server Interview Question. There are several ways of finding the nth highest salary. By the end of this video, we will be able to answer all the following questions as well. How to find nth highest salary in SQL Server using a Sub-Query How to find nth highest salary in SQL Server using a CTE How to find the 2nd, 3rd or 15th highest salary Let's use the following Employees table for this demo Use the following script to create Employees table Create table Employees ( ID int primary key identity, FirstName nvarchar(50), LastName nvarchar(50), Gender nvarchar(50), Salary int ) GO Insert into Employees values ('Ben', 'Hoskins', 'Male', 70000) Insert into Employees values ('Mark', 'Hastings', 'Male', 60000) Insert into Employees values ('Steve', 'Pound', 'Male', 45000) Insert into Employees values ('Ben', 'Hoskins', 'Male', 70000) Insert into Employees values ('Philip', 'Hastings', 'Male', 45000) Insert into Employees values ('Mary', 'Lambeth', 'Female', 30000) Insert into Employees values ('Valarie', 'Vikings', 'Female', 35000) Insert into Employees values ('John', 'Stanmore', 'Male', 80000) GO To find the highest salary it is straight forward. We can simply use the Max() function as shown below. Select Max(Salary) from Employees To get the second highest salary use a sub query along with Max() function as shown below. Select Max(Salary) from Employees where Salary [ (Select Max(Salary) from Employees) To find nth highest salary using Sub-Query SELECT TOP 1 SALARY FROM ( SELECT DISTINCT TOP N SALARY FROM EMPLOYEES ORDER BY SALARY DESC ) RESULT ORDER BY SALARY To find nth highest salary using CTE WITH RESULT AS ( SELECT SALARY, DENSE_RANK() OVER (ORDER BY SALARY DESC) AS DENSERANK FROM EMPLOYEES ) SELECT TOP 1 SALARY FROM RESULT WHERE DENSERANK = N To find 2nd highest salary we can use any of the above queries. Simple replace N with 2. Similarly, to find 3rd highest salary, simple replace N with 3. Please Note: On many of the websites, you may have seen that, the following query can be used to get the nth highest salary. The below query will only work if there are no duplicates. WITH RESULT AS ( SELECT SALARY, ROW_NUMBER() OVER (ORDER BY SALARY DESC) AS ROWNUMBER FROM EMPLOYEES ) SELECT SALARY FROM RESULT WHERE ROWNUMBER = 3
Views: 1054502 kudvenkat
Views in sql server   Part 39
 
14:51
In this video we will learn about 1. What is a view 2. Creating example views 3. Advantages of using views Text version of the video http://csharp-video-tutorials.blogspot.com/2012/09/views-in-sql-server-part-39.html Slides http://csharp-video-tutorials.blogspot.com/2013/09/part-39-views-in-sql-server.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 326116 kudvenkat
AngularJS Services
 
03:58
In this video we will discuss What is a service in Angular Why do we need services in an angular application What are the benefits of using services What is a service in AngularJS Before we talk about what a service is in Angular. Let's talk about a service in web development. If you have any experience developing web applications 1. You might have heard about Web Services and WCF Services 2. You might have also created objects that provide some services. For example, a Math object may provide services to add numbers. So, a service in Angular is simply an object that provide some sort of service that can be reused with in an angular application. The angular service object has properties and methods, just like any other JavaScript object. AngularJS has lot of built in services. We discussed two of the built in services - $http & $log, in our previous video. $http service is used to make AJAX calls. $log service is useful to log an object to the console, which is very useful when debugging applications. We can also create our own custom services, which we will discuss in a later video. For now let's understand the need for services. Why do we need services in an angular application The primary responsibility of the controller is to build the model for the view. The controller should not be doing too many things. For example, if the controller also has the logic to compute Age from Date of Birth, it violates one of the SOLID principles i.e the Single Responsibility Principle. The Single Responsibility Principle states that an object should only have a Single Responsibility. So this kind a logic belongs in it's own service, which can then be injected into the object that needs that service. In our previous video session, we have injected 2 of the angular built in services i.e $http and $log service into the controller function that needs them. In general, if the logic with in your controller, is becoming too large or too complex, then it is time, to take a step back, and think if anything can be abstracted into it's own service. Services can be used by controllers, directives and filters. What are the benefits of using services Reusability : In a service you usually have a logic that you want to reuse with in your entire application. For example, anytime you want to make AJAX calls, you can use one of the built in angular service - $http, simply by injecting it into the object that needs that service. The application is also easier to maintain when the reusable components are encapsulated into their own services. Dependency Injection : Another benefit of services, is that, they can simply be injected into controllers or other services that need them. Testability : Since services are injected into controllers or other services that need them, it becomes very easy to test them. Depending on which service you are testing, you can pass mock implementations or real implementations. If you are new to unit testing and mocking, don't worry, we will be covering these in detail in our upcoming videos. In our next video we will discuss, how to create a custom service, register and use it. Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/11/angularjs-services.html
Views: 187323 kudvenkat
Part 22 - C# Tutorial - Method hiding in c#.avi
 
12:03
Text version of the video http://csharp-video-tutorials.blogspot.com/2012/06/part-22-c-tutorial-method-hiding-in-c.html Slides http://csharp-video-tutorials.blogspot.com/2013/08/part-22-method-hiding-in-c.html All C# Text Articles http://csharp-video-tutorials.blogspot.co.uk/p/free-c-video-tutorial-for-beginners.html All C# Slides http://csharp-video-tutorials.blogspot.com/p/c.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists In this part of the c sharp tutorial we will learn 1. Method hiding 2. Invoke hidden base class members
Views: 292212 kudvenkat
Stored procedures in sql server   Part 18
 
20:11
In this video we will learn 1. What is a stored procedure 2. Stored Procedure example 3. Creating a stored procedure with parameters 4. Altering SP 5. Viewing the text of the SP 6. Dropping the SP 7. Encrypting stored procedure Text version of the video http://csharp-video-tutorials.blogspot.com/2012/08/stored-procedures-part-18.html Slides http://csharp-video-tutorials.blogspot.com/2013/08/part-18-stored-procedures.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 813682 kudvenkat
Angular reactive forms
 
10:49
In this video we will discuss reactive forms in Angular. There are 2 ways to create forms in Angular 1. Template Driven Forms 2. Reactive Forms (Also called Model Driven Forms) Here is the link to Angular CRUD playlist. We discussed Template forms in Part 5. https://www.youtube.com/playlist?list=PL6n9fhu94yhXwcl3a6rIfAI7QmGYIkfK5 Text version of the video http://csharp-video-tutorials.blogspot.com/2018/09/angular-reactive-forms.html Slides http://csharp-video-tutorials.blogspot.com/2018/09/angular-reactive-forms-slides.html Angular 6 Tutorial https://www.youtube.com/playlist?list=PL6n9fhu94yhWNJaDgh0mfae_9xoQ4E_Zj Angular 6 Tutorial Text Articles & Slides http://csharp-video-tutorials.blogspot.com/2018/09/angular-6-tutorial-for-beginners.html Angular, JavaScript, jQuery, Dot Net & SQL Playlists https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd As the name implies, Template Driven Forms are heavy on the template meaning we create the form completely in HTML. Template driven forms are easy to build and understand. They are great for creating simple forms. However, creating complex forms using template driven approach is not recomended as the HTML can get very complicated and messy. It is not easy to unit test template forms as the logic is in the HTML. Reactive forms on the other hand allow us to build the form completely in code. This is more flexible and has many benefits over template forms. For example, it is easy to add form input elements dynamically and adjust validation at runtime based on the decisions made in code. It is also easy to unit test as most of the logic and validation is in the component class. The only downside of reactive forms is that they require more code than template forms. In this video and in our upcoming videos we will discuss everything we need to know to build complex reactive forms. With a reactive form, we create the entire form control tree in the component class code. Let us understand this by creating a simple form with just 2 form controls as shown below.
Views: 72792 kudvenkat
Part 26   What is a windows service
 
05:56
Link for code samples used in the demo http://csharp-video-tutorials.blogspot.com/2014/02/part-26-what-is-windows-service_8.html Link for all dot net and sql server video tutorial playlists http://www.youtube.com/user/kudvenkat/playlists In this video, we will discuss 1. What is a windows service and how do they differe from regular applications and programs 2. How to view all the services installed on a windows machine 3. What is the use of windows services 4. When would an asp.net developer use a windows service What is a windows service and how do they differ from regular applications and programs A windows service is similar to any other program or application running on a windows machine. The following are the differences between a windows service and a regular application 1. Windows service runs in the background 2. They can be configured to start automatically when the system starts 3. They don't have user interface. How to view all the services installed on a windows machine 1. Open run windows by pressing Windows + R key 2. Type services.msc and press enter 3. The services window should display all the services installed on your computer What is the use of windows services Windows services provide core operating system features such as Event Logging - Windows Event Log Service Providing Security - Windows Firewall Service Error reporting - Windows Error Reporting Service When would an asp.net developer use a windows service In general, we should create a Windows Service to run code in the background all the time, without any sort of user interaction. An asp.net developer can use a windows service to host a wcf service. We can then configure the windows service to start automatically when the computer starts. This makes our WCF service always available for clients to consume, even if no-one is logged on, on that computer. In our next video, we will discuss, creating a windows service to host a WCF service
Views: 84766 kudvenkat
Deploy angular app to IIS
 
06:32
In this video we will discuss deploying angular application to IIS. Here are the steps Step 1 : Build your angular application. If you want to deploy a development build do a development build using the following Angular CLI command. The base-href option on the build command sets the base-href element in index.html to "/ePortal/" instaed of "/". In the IIS server, we will create an application with name "ePortal" in just a bit. ng build --base-href /ePortal/ If you want to deploy a production build do a production build using the following Angular CLI command. ng build --prod --base-href /ePortal/ In our case let's deploy a production build. After the build is complete, you will notice a folder with name "dist" in your Angular project folder. This folder contains all the build files. These build files need to be copied to a folder on the server where we have IIS installed. Step 2 : Create a folder on the server where you have IIS installed. You can name the folder anything you want. I am going to name the folder "ProductionBuild" and I am creating it in C:\ drive. Step 3 : Now copy all the contents of the "dist" folder into "ProductionBuild" folder Step 4 : Open IIS. There are several ways to do this. One way is to type "inetmgr" in the "Run" window and click "OK" Step 5 : Create an application in IIS. Name it "ePortal". This name has to match the value we have specified for the --base-href option in Step 1. a) Exapand the root IIS node b) Expand Sites c) Right click on "Default Web Site" and select "Add Application" from the context menu d) In the "Alias" textbox, type "ePortal" e) Set the "Physical Path" to folder that contains the build files. In our case it is "ProductionBuild" folder in C:\ drive At this point, if you launch the browser and navigate to http://localhost/ePortal/home, you will see the "home works" message as expected. When you click on the "Employees" tab it also works as expected. However, when you "Refresh" the page by pressing F5, you will see HTTP 404 error Step 6 : To fix this Page Refresh issue in Angular, include the following URL rewrite rule in you web.config file. This web.config file should be in copied the "ProductionBuild" folder where we have the rest of the build files. Please replace [ with LESS_THAN symbol and ] with GREATER_THAN symbol. [?xml version="1.0" encoding="utf-8"?] [configuration] [system.webServer] [rewrite] [rules] [rule name="AngularJS Routes" stopProcessing="true"] [match url=".*" /] [conditions logicalGrouping="MatchAll"] [add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /] [add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /] [add input="{REQUEST_URI}" pattern="^/(api)" negate="true" /] [/conditions] [action type="Rewrite" url="/ePortal" /] [/rule] [/rules] [/rewrite] [/system.webServer] [/configuration] Please note : You may also point the IIS application directly to the "dist" folder in RoutingDemo project folder. The downside of this is every time you rebuild your application, the "dist" folder is deleted and recreated. This means you will loose the web.config file and you have to create it again. Text version of the video http://csharp-video-tutorials.blogspot.com/2017/11/deploy-angular-app-to-iis.html Slides http://csharp-video-tutorials.blogspot.com/2017/11/deploy-angular-app-to-iis-slides.html Angular CLI Tutorial https://www.youtube.com/watch?v=rJ9o4TyhSuo&list=PL6n9fhu94yhWUcq5Pc16uf8YKXoZ87Vh_ Angular CLI Text articles & Slides http://csharp-video-tutorials.blogspot.com/2017/10/angular-cli-tutorial-for-beginners.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 55945 kudvenkat
Self join in sql server - Part 14
 
11:19
In this video we will learn about 1. Self Join - Joining a table with itself 2. Self Join is not a different type of join. It can be classified as Inner Self Join, Outer Self Join (Left, Right and Full), or Cross Self Join. Text version of the video http://csharp-video-tutorials.blogspot.com/2012/08/self-join-in-sql-server-part-14.html Slides http://csharp-video-tutorials.blogspot.com/2013/08/part-14-self-join.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 376918 kudvenkat
Angular aot vs jit
 
09:41
In this video we will discuss Ahead-of-Time compilation and Just-in-Time compilation in Angular. In Angular we have 2 models of compilation JIT - Just-in-Time Compilation : JIT compilation as the name implies, compiles the application Just-in-Time in the browser at runtime. AOT - Ahead-of-Time Compilation : AOT compilation compiles the application at build time. By default, with the development build we get JIT compilation. This is how it works. The application code along with the angular compiler is downloaded by the browser. At runtime, when a request is issued to the application, the JIT-compiler in the browser compiles the application code before it is executed. This means our user who made that first request has to wait for the application to compile first. In our previous videos we have seen that, when we build our angular application, the following JavaScript bundles are generated. Inline Main Polyfills Styles Vendor The vendor bundle contains the compiler along with the angular framework. The compiler code is roughly half of the Angular framework. There is a tool called source-map-explorer that we can use to inspect the JavaScript bundles. This tool analyzes the source map generated with the bundle and draws a map of all dependencies. To be able to use this tool we have to install it first. To install this tool, execute the following command npm install source-map-explorer --save-dev Once we have the tool installed, if you have not done the development build yet, do the development build using the following command. ng build Once the build is complete, you will have the JavaScript bundles along with the source map files. Now execute the following command. node_modules\.bin\source-map-explorer dist\vendor.bundle.js The above command runs the source-map-explorer against the vendor bundle and we see the graph of it. Notice the angular compiler is around 45% percent of the bundle size. As this is development build and not optimised, notice the total size of the bundle is 2.19 MB. With AOT compilation the angular application is pre-compiled. So this means the browser loads executable code so it can render the application immediately, without waiting to compile the application first. This also mean with AOT, as the application is already pre-compiled, there is also no need for the browser to download the Angular compiler. As we already know, the compiler code is roughly half of the Angular framework, so omitting it dramatically reduces the application size. By default, the production build is Ahead-of-Time compiled. So there is no need to bundle up the angular compiler code in the vendor bundle. This brings down the vendor bundle size by almost 50%. In addition it is also minified, uglified and tree-shaked to remove any code that we are not referencing in our application. So the bundler size is further reduced. Now, execute the following command to generate a production build. Notice I have also turned on sourcemap option. Without the sourcemap we will not be able to use the source-map-explorer tool. ng build --prod --sourcemap true Once the production build is complete, execute the following command. Vendor bundle name in your production build may be slightly different. Change it accordingly and execute the command. node_modules\.bin\source-map-explorer dist\vendor.7e385ef294695236ffd1.bundle.js The AOT compiler also detects and reports template binding errors at build time itself. Let us understand this with an example. Include the following function HomeComponent class in home.component.ts file getText(): string { return 'Hello Pragim'; } In home.component.html include the following [div] element. Notice I have deliberately mis-spelled the getText() function name. [div [innerText]='getTex()'] Save changes, and execute the following command. This command does a development build in-memory. At the moment we are not using AOT, so we will not know about the template binding error that is introduced above. Notice at build time we do not see any errors. ng serve Text version of the video http://csharp-video-tutorials.blogspot.com/2017/11/angular-aot-vs-jit.html Slides http://csharp-video-tutorials.blogspot.com/2017/11/angular-aot-vs-jit-slides.html Angular CLI Tutorial https://www.youtube.com/watch?v=rJ9o4TyhSuo&list=PL6n9fhu94yhWUcq5Pc16uf8YKXoZ87Vh_ Angular CLI Text articles & Slides http://csharp-video-tutorials.blogspot.com/2017/10/angular-cli-tutorial-for-beginners.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 25861 kudvenkat
Logging deadlocks in sql server
 
04:25
trace sql server deadlock sql server deadlock log how to log deadlocks in sql server sql server deadlock log file sql logging deadlocks trace deadlocks in sql server 2008 sp_readerrorlog Text version of the video http://csharp-video-tutorials.blogspot.com/2015/08/logging-deadlocks-in-sql-server.html Slides http://csharp-video-tutorials.blogspot.com/2015/08/logging-deadlocks-in-sql-server_27.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists In this video we will discuss how to write the deadlock information to the SQL Server error log When deadlocks occur, SQL Server chooses one of the transactions as the deadlock victim and rolls it back. There are several ways in SQL Server to track down the queries that are causing deadlocks. One of the options is to use SQL Server trace flag 1222 to write the deadlock information to the SQL Server error log. Enable Trace flag : To enable trace flags use DBCC command. -1 parameter indicates that the trace flag must be set at the global level. If you omit -1 parameter the trace flag will be set only at the session level. DBCC Traceon(1222, -1) To check the status of the trace flag DBCC TraceStatus(1222, -1) To turn off the trace flag DBCC Traceoff(1222, -1) To read the error log execute sp_readerrorlog
Views: 43085 kudvenkat
FromBody and FromUri in Web API
 
07:15
Text version of the video http://csharp-video-tutorials.blogspot.com/2016/09/frombody-and-fromuri-in-web-api.html Slides http://csharp-video-tutorials.blogspot.com/2016/09/frombody-and-fromuri-in-web-api_19.html All ASP.NET Web API Text Articles and Slides http://csharp-video-tutorials.blogspot.com/2016/09/aspnet-web-api-tutorial-for-beginners.html All ASP.NET Web API Videos https://www.youtube.com/playlist?list=PL6n9fhu94yhW7yoUOGNOfHurUE6bpOO2b All Dot Net and SQL Server Playlists https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd
Views: 113313 kudvenkat
CTE in sql server   Part 49
 
12:57
In this video we will learn about creating and referencing CTE's in SQL server. We will also learn how to create multiple CTE's using a single WITH clause. Text version of the video http://csharp-video-tutorials.blogspot.com/2012/09/common-table-expressions-part-49.html Slides http://csharp-video-tutorials.blogspot.com/2013/09/part-49-cte.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists
Views: 207743 kudvenkat
Part 15   Exception handling in WCF
 
09:39
Link for code samples used in the demo http://csharp-video-tutorials.blogspot.com/2013/12/part-15-exception-handling-in-wcf_5.html Link for all dot net and sql server video tutorial playlists http://www.youtube.com/user/kudvenkat/playlists When an exception occurs in a WCF service, the service serializes the exception into a SOAP fault, and then sends the SOAP fault to the client. By default unhandled exception details are not included in SOAP faults that are propagated to client applications for security reasons. Instead a generic SOAP fault is returned to the client. For debugging purpose, if you want to include exception details in SOAP faults, enable IncludeExceptionDetailInFaults setting. This can be done in 2 ways as shown below. 1. In the config file using service behavior configuration [behaviors] [serviceBehaviors] [behavior name="inculdeExceptionDetails"] [serviceDebug includeExceptionDetailInFaults="true"/] [/behavior] [/serviceBehaviors] [/behaviors] 2. In code using ServiceBehavior attribute [ServiceBehavior(IncludeExceptionDetailInFaults=true)] public class CalculatorService : ICalculatorService { public int Divide(int Numerator, int Denominator) { return Numerator / Denominator; } } Frequently asked WCF interview questions What happens when an exception occurs in a WCF service? OR What is a SOAP fault? OR How are WCF service exceptions reported to client applications?
Views: 76793 kudvenkat
sql server dirty read example
 
08:50
Text version of the video http://csharp-video-tutorials.blogspot.com/2015/08/sql-server-dirty-read-example.html Slides http://csharp-video-tutorials.blogspot.com/2015/08/sql-server-dirty-read-example_15.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists In this video we will discuss, dirty read concurrency problem with an example. This is continuation to Part 70. Please watch Part 70 from SQL Server tutorial for beginners. A dirty read happens when one transaction is permitted to read data that has been modified by another transaction that has not yet been committed. In most cases this would not cause a problem. However, if the first transaction is rolled back after the second reads the data, the second transaction has dirty data that does not exist anymore. SQL script to create table tblInventory Create table tblInventory ( Id int identity primary key, Product nvarchar(100), ItemsInStock int ) Go Insert into tblInventory values ('iPhone', 10) Dirty Read Example : In the example below, Transaction 1, updates the value of ItemsInStock to 9. Then it starts to bill the customer. While Transaction 1 is still in progress, Transaction 2 starts and reads ItemsInStock value which is 9 at the moment. At this point, Transaction 1 fails because of insufficient funds and is rolled back. The ItemsInStock is reverted to the original value of 10, but Transaction 2 is working with a different value (i.e 10). Transaction 1 : Begin Tran Update tblInventory set ItemsInStock = 9 where Id=1 -- Billing the customer Waitfor Delay '00:00:15' -- Insufficient Funds. Rollback transaction Rollback Transaction Transaction 2 : Set Transaction Isolation Level Read Uncommitted Select * from tblInventory where Id=1 Read Uncommitted transaction isolation level is the only isolation level that has dirty read side effect. This is the least restrictive of all the isolation levels. When this transaction isolation level is set, it is possible to read uncommitted or dirty data. Another option to read dirty data is by using NOLOCK table hint. The query below is equivalent to the query in Transaction 2. Select * from tblInventory (NOLOCK) where Id=1
Views: 78259 kudvenkat
Angular promises vs observables
 
09:47
Text version of the video http://csharp-video-tutorials.blogspot.com/2017/09/angular-promises-vs-observables.html Slides http://csharp-video-tutorials.blogspot.com/2017/09/angular-promises-vs-observables_5.html Angular 2 Tutorial playlist https://www.youtube.com/playlist?list=PL6n9fhu94yhWqGD8BuKuX-VTKqlNBj-m6 Angular 2 Text articles and slides http://csharp-video-tutorials.blogspot.com/2017/06/angular-2-tutorial-for-beginners_12.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists In this video we will discuss the differences between promises and observables. In Angular 2, to work with asynchronous data we can use either Promises or Observables. In our previous videos in this series, we discussed using both Observables and Promises. There are several differences between Promises and Observables. In this video let's discuss these differences. A Promise emits a single value where as an Observable emits multiple values over a period of time. You can think of an Observable like a stream which emits multiple items over a period of time and the same callback function is called for each item emitted. So with an Observable we can use the same API to handle asynchronous data whether that data is emitted as a single value or multiple values over a period of time. A Promise is not lazy where as an Observable is Lazy. A Promise cannot be cancelled where as an Observable can be cancelled using the unsubscribe() method Observable provides operators like map, forEach, filter, reduce, retry, retryWhen etc
Views: 92359 kudvenkat
Snapshot isolation level in sql server
 
09:16
Text version of the video http://csharp-video-tutorials.blogspot.com/2015/08/snapshot-isolation-level-in-sql-server.html Slides http://csharp-video-tutorials.blogspot.com/2015/08/snapshot-isolation-level-in-sql-server_19.html All SQL Server Text Articles http://csharp-video-tutorials.blogspot.com/p/free-sql-server-video-tutorials-for.html All SQL Server Slides http://csharp-video-tutorials.blogspot.com/p/sql-server.html All Dot Net and SQL Server Tutorials in English https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd All Dot Net and SQL Server Tutorials in Arabic https://www.youtube.com/c/KudvenkatArabic/playlists In this video we will discuss, snapshot isolation level in sql server with examples. Just like serializable isolation level, snapshot isolation level does not have any concurrency side effects. What is the difference between serializable and snapshot isolation levels Serializable isolation is implemented by acquiring locks which means the resources are locked for the duration of the current transaction. This isolation level does not have any concurrency side effects but at the cost of significant reduction in concurrency. Snapshot isolation doesn't acquire locks, it maintains versioning in Tempdb. Since, snapshot isolation does not lock resources, it can significantly increase the number of concurrent transactions while providing the same level of data consistency as serializable isolation does. Let us understand Snapshot isolation with an example. Open 2 instances of SQL Server Management studio. From the first window execute Transaction 1 code and from the second window execute Transaction 2 code. Notice that Transaction 2 is blocked until Transaction 1 is completed. --Transaction 1 Set transaction isolation level serializable Begin Transaction Update tblInventory set ItemsInStock = 5 where Id = 1 waitfor delay '00:00:10' Commit Transaction -- Transaction 2 Set transaction isolation level serializable Select ItemsInStock from tblInventory where Id = 1 Now change the isolation level of Transaction 2 to snapshot. To set snapshot isolation level, it must first be enabled at the database level, and then set the transaction isolation level to snapshot. -- Transaction 2 -- Enable snapshot isloation for the database Alter database SampleDB SET ALLOW_SNAPSHOT_ISOLATION ON -- Set the transaction isolation level to snapshot Set transaction isolation level snapshot Select ItemsInStock from tblInventory where Id = 1 From the first window execute Transaction 1 code and from the second window, execute Transaction 2 code. Notice that Transaction 2 is not blocked and returns the data from the database as it was before Transaction 1 has started. Modifying data with snapshot isolation level : Now let's look at an example of what happens when a transaction that is using snapshot isolation tries to update the same data that another transaction is updating at the same time. In the following example, Transaction 1 starts first and it is updating ItemsInStock to 5. At the same time, Transaction 2 that is using snapshot isolation level is also updating the same data. Notice that Transaction 2 is blocked until Transaction 1 completes. When Transaction 1 completes, Transaction 2 fails with the following error to prevent concurrency side effect - Lost update. If Transaction 2 was allowed to continue, it would have changed the ItemsInStock value to 8 and when Transaction 1 completes it overwrites ItemsInStock to 5, which means we have lost an update. To complete the work that Transaction 2 is doing we will have to rerun the transaction. Snapshot isolation transaction aborted due to update conflict. You cannot use snapshot isolation to access table 'dbo.tblInventory' directly or indirectly in database 'SampleDB' to update, delete, or insert the row that has been modified or deleted by another transaction. Retry the transaction or change the isolation level for the update/delete statement. --Transaction 1 Set transaction isolation level serializable Begin Transaction Update tblInventory set ItemsInStock = 5 where Id = 1 waitfor delay '00:00:10' Commit Transaction -- Transaction 2 -- Enable snapshot isloation for the database Alter database SampleDB SET ALLOW_SNAPSHOT_ISOLATION ON -- Set the transaction isolation level to snapshot Set transaction isolation level snapshot Update tblInventory set ItemsInStock = 8 where Id = 1
Views: 67388 kudvenkat
Part 79   Areas in asp net mvc
 
17:40
Link for code samples used in the demo http://csharp-video-tutorials.blogspot.com/2013/08/part-79-areas-in-aspnet-mvc.html Link for csharp, asp.net, ado.net, dotnet basics, mvc and sql server video tutorial playlists http://www.youtube.com/user/kudvenkat/playlists When you create a new asp.net mvc application, the following folders are created with in the root directory. 1. Models 2. Views 3. Controllers This structure is fine for simple applications, but when your application gets big and complex, maintaining your Models, Views and Controllers can get complicated. The structure of a complex asp.net mvc application can be very easily maintained using areas. So, in short areas are introduced in asp.net mvc 2, that allow us to breakdown a large complex application into a several small sections called areas. These areas can have their own set of 1. Models 2. Views 3. Controllers 4. Routes Let's understand this with an example. Let's understand this with an example. Let's say, we are building a Job Portal. It's common for a typical job portal to have the following functional areas. Employee Area - This functional area allows a job seeker to create their profile, upload resume, and perform job search. Employer Area - This functional area allows a job provider to create employer profile, upload jobs, and search for suitable candidates. Administrator Area - This functional area allows an administrator to configure the site and mantain. To create an area in an MVC application 1. Right click on the project name in Solution Explorer and select Add =] Area 2. Provide a meaningful name. For example "Employee" and click Add At this point, "Areas" folder will be created, and with in this, a folder for Emploee area will be added. You can add as many areas as you want. In a similar fashion, add areas for Employer and Admin. Notice that in each area folder (Employee, Employer and Admin), you have a set of Models, Views and Controllers folders. Also, there is "AreaRegistration.cs" file, which contains the code to register a route for the area. Now navigate to Global.asax.cs file and notice Application_Start(). With in this method there is code to register all areas in your application. protected void Application_Start() { AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); } At this point Add "HomeController" to the following areas. Notice that we can have a HomeController(Controller with the same) in Employee, Employer, Admin and MainArea. 1. Employee 2. Employer 3. Admin 4. Main Area At this point, we have Index() action method in all of the HomeControllers. public ActionResult Index() { return View(); } Now Add Index view to all the areas. Copy and paste the following HTML in respective Index views. Main Area: [h1]Main Area Index View[/h1] Employee Area: [h1]Employee Area Index View[/h1] Employer Area: [h1]Employer Area Index View[/h1] Admin Area: [h1]Admin Area Index View[/h1] At this point, build the application, and navigate to /MVCDemo. You will get an error. To fix this change RegisterRoutes() method in RouteConfig.cs file in App_start folder. Notice that we are passing the namespace of the HomeController in the Main area using namespace parameter. public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }, namespaces: new [] { "MVCDemo.Controllers" } ); } Now, if you navigate to /MVCDemo/Employee, you will get an error - The resource cannot be found. To fix this, change RegisterArea() area method in EmployeeAreaRegistration.cs file in Employee folder as shown below. Notice that we are setting HomeController as the default controller public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute( "Employee_default", "Employee/{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); } Navigating to http://localhost/MVCDemo/Employee may throw a compilation error related to System.Web.Optimization. If you get this error follow the steps below. 1. In Visual Studio, click Tools - Library PAckage Manager - Package Manager Console 2. In the Package Manager Console window, type the following command and press enter Install-Package Microsoft.Web.Optimization -Pre When we are building links using ActionLink() html helper to navigate between areas, we need to specify area name. once you do this, you will be able to navigate between areas when you click on the respective links.
Views: 90117 kudvenkat