Html GridView in MVC3

When ever we need to create a grid in MVC 3, we often end up with Telerik grids, due to awesome features and support. But you need to have a licensed version of controls.
What if you don't have license for it and you have to create a Gridview of your own, like below.
Its very simple, and all you need to create is a little Html, JQuery and supporting Action Methods.
Lets see how . . .


Implementing & Consuming ASP.NET WEB API from JQuery (MVC 4)

In this post we will see how to create a our own WEB API service and will consume it in client using JQuery.
This is the UI i am planning to create, which in-turn talk to a ASP.NET WEB API Service for rendering data. We need to create a API Service and an Application consuming it.
Lets do it step by step.


In earlier post we read about how WEB API evolved and what are the features that made it as one of the best frameworks to build or consume HTTP Services.

While going through the post, keep one thing in mind that WEB API is REST Complaint, so it typically consists of Get(),Put(),Post(),Delete() methods.
           Method                                        URL Structure
             Get()                                            api/Values
             GetItem(int i)                              api/Values/i
             Post (i)                                         api/Values/i with Post method
             Delete(i)                                      api/Values/i with Delete method.

Before writing tons of your custom code, lets see what the default scaffold template has given for a WEB API interface.


History Behind ASP.NET WEB API

It is a framework for building and consuming HTTP services that can reach a broad range of clients including browsers and mobile devices. It’s also a great platform for building RESTful services. ASP.NET Web API takes the best features from WCF Web API and merges them with the best features from MVC.
Even before touching code, we need to know why WEB API?

It started with WCF


OData defines an abstract data model and a protocol that let any client access information exposed by any data source. Figure 1 shows some of the most important examples of clients and data sources, illustrating where OData fits in the picture.
 Before going into more details , first look into below videos explaining What and Why.


Merge in SQL 2008

Many a times we came across situation to merge records between two tables. It will be like incremental update i.e., add new records and update existing records based on a reference column.

We usually accomplish this in two statements.
1. A join statement to update records.
2. A insert statement for new records.

Lets execute and see how this works.