Showing posts from 2016

Understanding WCF Bindings

Binding describes that how a client will communicate with WCF service. It tells that what protocol will be used to communicate, as WCF supports various protocols like HTTP, TCP, MSMQ, Named Pipes.

Binding determine transport protocol i.e. TCP, HTTP, message exchange format i.e. plain text, XML

You may go through to my earlier blogs to know about ABC of WCF


What is ABC of WCF? WCF service comes into existence with a valid EndPoint.  An endpoint consists of 3 major components.

First WCF Service Application - WCF Tutorial

In this blog, I will be creating a WCF service application project. If you want to learn WCF from the beginning, please read my earlier blog.

How to maintain page scroll position after page post back in

In this blog, I will write about How to maintain page scroll position after page post back in ASP.Net.
Suppose there is a page with a huge number of inputs and in one case some error/exception occurs at bottom of the page. But in postback page scroll position moved to the top.

Differences between Stored Procedure and Functions

Very frequent question asked in interview is Differences between Stored Procedure and Functions.
Below are the differences between these 2.

How to call ASP.Net web method using JQuery AJAX

In normal ASP.NET web forms, if you want to send any data to server your web page will be refreshed i.e. will do a postback.
In some case, if you want to send data to the server without using any post back then in this case you have to use a web method at server side and that will be called from JQuery side.

Java Script Code to detect browser and apply CSS property

How to detect browser using Java Script Code and apply CSS property ? As we all know that IE browser behaves unexpected in some cases and need some extra CSS property or change in CSS property to work/view perfectly.

Fault Contract in WCF - WCF Service Tutorial

In this article, we will see how to implement Fault Contract in WCF.

Data Contract vs Message Contract in WCF - WCF Service Tutorial

If you are new to Data Contract and Message Contract. Please read my earlier blogs. Data Contract Message Contract

Data Contract has very less control over SOAP message, while Message Contract has full control.

Message Contract in WCF - WCF Service Tutorial

If you are new to WCF Service, please read my earlier blogs. WCF Introduction and WCF Contracts
As we know the default message protocol in WCF is SOAP. Message contract is used to define the SOAP structure.

Query with OData in SharePoint 2013

OData, i.e. Open Data Protocol, which defines a protocol for the querying and updating of data.
In this blog, we will see the use of oData in ASP.Net.

What is OAuth?

OAuth stands for Open Authorization for token based authentication and authorization over web.

OAuth was first introduced in year 2007. In year 2010 OAuth2.0 was introduced.

How to insert Data using Entity Framework

If you are new to Entity Framework, then read my earlier blog - Introduction to Entity Framework
This blog will help you about How to insert data into sql using Entity Framework.
I have used Database first model approach.

Introduction to Entity Framework - Entity Framework Tutorial

In my another blog, I have explored about ASP.Net and ASP.Net Core. In this blog, we will see about Entity Framework.
What is Entity Framework? Entity Framework is an object-relational mapping which allows developers to work with relational databases. Entity Framework is an open source framework.

What are Idempotent and Non Idempotent methods?

Idempotent Methods and Non Idempotent methods
Let's start by understanding the meaning of Idempotent.
Idempotent means  "unchanged in value following multiplication by itself"

Idempotent HTTP methods are those methods which will not make any modification event after calling multiple times.

Data binding directly to a store query (DbSet, DbQuery, DbSqlQuery) is not supported - Entity Framework

In the previous blog, we have seen about Entity Framework.
In this blog, we will see error resolution related to Data binding directly to a store query.
In Visual Studio 2015 I was using Entity Framework and wrote a code to bind data with GridView. I wrote the normal Linq and browse my web page. And surprised to see below line of error:

Create a login module using Entity Framework

If you are new to Entity Framework then read my earlier blog on this.
In this blog I will explain about how to create a login module using entity framework.

How to create secure Web API in

In my earlier blog I wrote about how to create a web api in , now your WebAPIi is ready to work.

Web API security is very important especially if you are allowing it to external users to consume it.

The underlying provider failed to open - Entity Framework Error

I found this error - "The underlying provider failed to open" while I was working on Entity framework project.

Business Connectivity Service in SharePoint 2013

In this blog, we will see what's new in BCS in SharePoint 2013. BCS stands for Business Connectivity Services which returns the result to the user through an external list or data sources.

Design Patterns in ASP.Net

If you are an ASP.Net developer or any other programming technologies, then you must have came across the word Design Patter.
In this blog, we will see What are design patterns and their types

Dispose vs Close

In this blog, we will see the differences between Dispose() and Close()

SharePoint 2013 Installation step by step

In this blog, I will explain about SharePoint 2013 installation on Windows Server 2008 R2, which I did recently on my system.
Below is minimum software requirement for SharePoint 2013 installation.
OS-  Windows Server 2008 R2 (Service Pack1) or above
SQL Server - SQL Server 2008 SP1 or above.

How do i get ASP.Net Web API to return JSON

In my earlier blog, we have seen How to create a Web API? In this blog, we will see about how to return JSON data instead of XML in Web API.
ASP.Net Web API returns XML by default. But we can change so that it should return JSON instead of XML.

How to create ASP.Net Web API

In this blog, I have created ASP.Net web api using Visual Studio 2015.
If you need to know what is web api then please read one of my previous blog.

MVC Architecture

In this blog, we will try to understand the MVC Architecture with the help of a diagram.

MVC Version

MVC was first introduced in .Net 3.5 framework.
MVC 1.0 was available in year 2009 with following features:
Routing, HTML Helpers, Auto Binding. Since then multiple versions were introduced with various .Net framework.

What is Web API? When should we use in our projects?

Web API is the Microsoft open source technology for developing REST services based on HTTP protocol. ASP.Net Web API is a framework for building, consuming HTTP based service. The advantage of Web API is that it can be consumed by a wide range of clients like a web browser and mobile applications.

Angular JS model and controller

Angular JS Model:

ng-model directive in Angular JS is use to bind the value of an HTML control to any variable.

<div ng-app="testApp" ng-controller="testCtrl">
    Name: <input ng-model="name">
<h1>Hello : {{name}}</h1>

Google API to authenticate on website using Java Script

In the previous blog, I have explained about How to create App in Facebook and how to authenticate using Java Script Code.
In this blog, I will explain how you can use Google API to authenticate users using Google Account and allow them to logged in to your own website.

To do this you need to create an App/Project in Google developer dashboard which will allow your website users to authenticate using OAuth.

Razor View and ASPx in MVC

In MVC 5 we have only one way to create View which is Razor View, the file extension of razor view is ".cshtml"
But before MVC 5 we had one more option which was ASPX, now in MVC 5 ASPX has been removed and currently, Razor view is available with MVC 5.

My first ASP.Net MVC Program

In all my blog I will be giving example/code in context of Visual Studio 2015.
So first create a MVC project in VS 2015.

Introduction to ASP.Net MVC

In this blog, we will know about ASP.NET MVC.
This is my first blog on MVC.

Insert record in database using angular js

In this blog I will explain about how we can save data in SQL database using Angular JS.
In this example i have written a web method which is available in .cs file.

Data Contract Serialization and De-Serialization - WCF Service Tutorial

Serialization is the process of converting an object to transferable data format. By default WCF uses DataContractSerializer. And vice-versa process is called De-Serialization.

Angular JS Ng-repeat directive

In this blog I will explain about ng-repeat directives in Angular JS. ng-repeat repeats set of HTML.

Introduction to Angular JS.

What is Angular JS? Angular JS is Java Script framework introduced by Google in 2012 (version 1.0). It is an open source. Angular JS allows a developer to write a powerful client-side coding. To work with Angular JS just download angular js file from and reference it into your HTML, ASPX page.

Upload a file using JQuery and Generic Handler in ASP.Net

In this blog we will learn how to use jquery and generic handler in to upload a file.
I have used Jquery to call a generic handler to upload a file.

In this blog I have written code which accepts jpg file only and file size should not exceed 10 MB.
You may customize as per your need.

Data Contract in WCF

In my earlier blog, I wrote about Other Contracts. Please refer this link Contracts in WCF
Here we will learn about Data Contract.

Create Datatable using .Net Client Context in SharePoint 2010

Create Data Table while using SharePoint 2010 Client Context with .Net Code

I am using .net code to access SharePoint List.
I created a method ExecuteSPQuery() which returns Data Table.

What is Operation Contract in WCF Service?

In my earlier blog I wrote about Contracts and Service Contract. Please refer this link Service Contract in WCF

Here we will learn about Operation Contract.

What is Service Contract in WCF?

Service Contract in WCF Contracts in WCF are very important. Contracts are responsible for how to communicate, what protocol to use and what message to send.

WAS Hosting in WCF Service

As we all know that IIS 6 supports HTTP protocol only.
Windows Process Activation Service (WAS) supports non-http protocols in IIS. So, WAS helps WCF service to host with HTTP and NO-HTTP protocols such as net.tcp.

Self Hosting a WCF service

As we know WCF supports various hosting options. Self Hosting is one of them.
What is Self Hosting?
WCF allows hosting a service in an application such as Console Application.

How to Host a WCF Service in IIS

If you are new to WCF services then please read my earlier blogs. Go through with this link - WCF Tutorial step by step.

WCF supports a various way to host a service. In this blog, I will explain about Hosting a WCF Service in IIS.

Write Power Shell Script to Lock and Unloock a Site in SharePoint 2010

Below Power Shell Script will Unlock a SharePoint site if it is in locked/read-only.

#Region variable declaration
Write-Host "UnLock status started....."
Add-PSSnapin Microsoft.Sharepoint.Powershell
Set-SPSite -Identity "<site-url>" -LockState "Unlock"
Write-Host "Task completed....."
Read-Host -Prompt "The above error occurred. Press Enter to exit."

For -LockState attribute there are mainly 4 parameters that can be used:

Unlock - To unlock site collection and make it available to users.
NoAdditions - Prevent users from adding new content to the site collection. Updates and deletions are still allowed.
ReadOnly - Prevent users from adding, updating, or deleting content.
NoAccess - Prevent users from accessing the site collection and its content.

Introduction of JSON

What is JSON?
JSON stands for Java Script Object Notation. JSON is a data exchange format between java script and server side language like jsp, etc.

SPQuery and SPSiteDataQuery in SharePoint

Before reading this blog, you may also like to know about CAML Query. You can know about CAML Query in details.

In this blog, we will see SPQuery and SPSiteDataQuery.

Important SQL Query asked in Interview

Important SQL Query asked in Interview

SQL query to check a record in table, if exist then insert else update the record.

Attach existing Content Database to new SharePoint Site Collection

This blog will describe how to attach, detach a content database.
Below is the scenario -

You created a new Site collection in SharePoint 2010.
Now you want this site collection to work with your existing Content database.

Simply you can be asked that you have an existing content database and you need to attach it with the new Site collection.

What is JQuery Callback Function

What is JQuery Callback Function?

A call back function executed after the current event has completed. Java Script code executes line by line. However, if next line of code executes even before completing the action(s) which wrote in previous lines. This may create an error.

JQuery Events Methods

Like a programming language, a JQuery also has some events. JQuery event occurs on a web page when a user takes some actions like the mouse click, mouse scroll, check box selection etc.

JQuery Selectors

JQuery selectors allow you to select and manipulate HTML elements. JQuery selectors find HTML elements based on id, name, attribute, classes etc.

Master Page and Branding in SharePoint 2010

MasterPage and Branding in SharePoint  What is branding? - Branding means to design or recreate a page for a site which may use SharePoint Master Page.

What is new in SharePoint 2013?

SharePoint 2013 is the next version of SharePoint 2013.

Display SharePoint List Items using ECMA Script - Client Object Model

Display SharePoint List Items using ECMA Script In this blog, I will explain, how to get list items using ECMA Script.
ECMA script is a client side way to work with SharePoint object.

Create a web part page in page library. Add a content editor web part on that page.
In content editor webpart write below code:

REST API in SharePoint 2010 for CRUD operation with ListData.svc

REST API in SharePoint 2010 for CRUD Operation SharePoint 2010 offers numerous ways to get data from a list. You may use Client Object Model, Linq to SharePoint and REST API by using ListData.svc. In this blog, I will explain how to perform CRUD operation on a SharePoint list using ListData.svc

WCF tutorial - Learn WCF quickly

WCF tutorial - Learn WCF quickly WCF stands for Windows Communication Foundation and used for developing distributed system. WCF services can communicate with.Net applications and Non-Microsoft technology as well.

Error - The user does not exist or is not unique SharePoint 2010

Currently I was doing some settings for super account
In this context, I executed below command in powershell window.

stsadm -o setproperty -propertyname portalsuperreaderaccount -propertyvalue account -url "<site-url>"

MasterPages in SharePoint 2013

As we know that there are huge changes in look and feel of SharePoint 2013 while compare to SharePoint 2010. This is all because of Master Page.
There are 2 types of MasterPage which is being used in SharePoint 2013. Oslo masterpage and Seattle masterpage
On Oslo masterpage left nav is removed and in Seattle master page left nav is available.
Oslo master page uses oslo.css instead of corev15.css

Client Side Object Model in SharePoint 2010

SharePoint 2010 offers a useful way to access SharePoint objects from the client side. A developer can use .Net managed code, ECMAScript to access SharePoint objects like List, Site, Library etc.

On this blog, I will write a code to select data from SharePoint list. I will use .Net managed code to do this.

Migrate SharePoint 2010 Application to SharePoint 2013 Step by Step

Migrate SharePoint 2010 to SharePoint 2013, Step by Step
In this blog, I will explain about migration from SharePoint 2010 to SharePoint 2013 which I did.

Show Hide div area in Angular JS

This is my second post on angular js.

In this post I have create 2 radiobutton and will show hide a div area on basis of selection.

Create a "AngularModelController.js" file and write below code:

C# code to convert xml into Dataset

How to convert xml file into dataset in C# programming.
In this blog i will show you how we can get xml data into a dataset.

SQL Server Interview Questions Part2

Few important questions for SQL Server asked ASP.Net Developer. Part- 2

Indexes are used to query data faster from a table. Indexing avoids full table scan.

Use SharePoint Searchservice to get content from public site

How to crawl a public website content into a SharePoint site?

Just now i developed this module, the scenario is:

I have a page in SharePoint and I want to search content from other public websites and want to show the result in a data source into my Page.

First you need to configure search service.
Create scope, each scope should be used for an individual website url, so that we can filter result on base of scope in our query.

Now once you are done with configuration and settings. Lets start our coding in Visual Studio.

SQL Server Interview Questions.

In this blog, we will see some of the important SQL Interview Questions and Answers.

JQuery Tutorial

What is JQuery?

· Jquery is a light weight java script library.
· JQuery is cross browser.
· Easy to write compare to java script.

$(document).ready is a jquery event. It fires as soon as the DOM is loaded.
This event is fired before all the images, css are fully loaded.

$(window).load event fires when DOM and all content (images, css) loads.

What is DOM?
The HTML DOM (Document Object Model), when a web page is loaded, the browser creates a Document Object Model of that page.
The HTML DOM model is constructed as a tree of Objects like HTML, HEAD, Body, H1, P etc.

Oops interview questions and answers

In this blog, I have collected Interview questions and answers of OOPS (Object Oriented Programming System).