Skip to main content

Posts

What is Stored Procedure in MS SQL?

A Stored Procedure is a group of sql statements that has been created and stored in the database. Advantages It is actually stored in the database data dictionary and Pre compiled one. We can call any number of times from our program.  Reduce the need to encode the logic elsewhere in client programs. Stored procedure will reduce network traffic and increase the performance. Consider if we have repeat statements to call then how many times we have to call Database better a single stored procedure can use for all the statements and a single call is enough instead of multiple calls. A single procedure can be used over the network by several clients using different input data.  If we modify stored procedure all the clients will get the updated stored procedure. Security - Stored Procedure can be granted access rights to the database that users who execute those procedures do not directly have. Stored Procedure c...

Null Conditional Operators (?.) in C# 6.0 (New Feature)

Here I am discussing about the new feature called “ null-conditional operators ” introduced in C# 6.0 (VS 2015 and .Net 4.6). First we can see the old way, InvoiceDetails = Invoice != null ?   Invoice.InvoiceDetails : null; If(Invoice != null && Invoice. InvoiceDetails  != null) {      Amount = Invoice. InvoiceDetails.Amount. ; } else {     Amount = 0; } Or  Amount = Invoice != null ? (Invoice.InvoiceDetails != null ? Invoice.InvoiceDetails.Amount : 0) : 0;      In the above code used null conditional operator, nested if statements etc. In  C# 6.0 provides the new way to check for Null. We can use  Null-conditional operator (“?.”) for reduce number of lines of codes. InvoiceDetails = Invoice?.InvoiceDetails; If all of the conditions are met, this will return the actual value; otherwise, it will return null. It checks the InvoiceDetails object and returns a value if Invoice is not equal to null; e...

How WCF Method Overloading Works

Let's first define overloading so that we may better comprehend this topic.       The process of implementing polymorphism in object-oriented programming is known as method overloading. There is no requirement that the parameters in two methods be of the same type; a method can be overloaded based on the type, quantity, and order of its parameters. Many of us believe that WCF supports method overloading because C# does. No, in actuality. Why?  Consider the following example: [ ServiceContract ]   public interface IMyService   {   [ OperationContract ]    ExampleData[] GetExampleData( string Code);   [ OperationContract ]   ExampleData [] GetExampleData(string Code, DateTime date);  } Now that you have implemented this interface and hosted it as a WCF service, it will fail with a contract mismatch error since the WSDL forbids the creation of duplicate client methods. We can now review the defini...

OOP Concept with Real Time Examples

A design philosophy is OOP. Object Oriented Programming is what it stands for. In contrast to outdated procedural programming languages, object-oriented programming (OOP) employs a separate set of programming languages. In OOP, everything is categorised as self-sustaining "objects". As a result, you achieve re-usability using the four core concepts of object-oriented programming. Programmes are organised around objects and data rather than action and logic in the object-oriented programming (OOP) paradigm.    Let's use your "Leg" as an example to grasp the object orientation clearly. The class "Leg" is one. Left and right legs are objects of type Leg on your body. A series of electrical impulses supplied through your body parts (through an interface) are what manage or control their primary functions. As a result, the body part serves as an interface between your body and your legs. The Leg is a well-designed class. The attributes of the Leg are m...