Saturday, 30 March 2013

Click Here to Download

In this article we are demonstrating how Insert, Update, View and Delete operation works in Output using HTTP service.
We can also call as CRUD (Create, Read, Update, Delete) Operation.

In this WebAPI example we are using following HTTP Methods for CURD Operations.

  • GET method retrieves the data or resources at a specified URI.
  • PUT method updates the data or resource at a specified URI.
  • POST method send data to the specified URI.
  • DELETE method deletes a resource at a specified URI.

Now we are creating project step by step.

STEP 1 :

Create a Web API Project.

Saturday, 16 March 2013

There are situations where we had date in string format in string variable and want to check that this string contains specific date format or not and if this date is in pacific format, then convert it to date time object.

By checking this, we can avoid any date time conversion run time errors. We can do this using "TryParseExact" method of "DateTime" Class.

Here is an Example for this.

Friday, 8 March 2013

Click Here to Download

ASP.NET Web API is a framework for developing web APIs on top of the .NET Framework. Web API serves data on HTTP. HTTP service is so powerful and compatible with various clients and platform.

Web API uses in Mobile devices, various browsers and in desktop applications to get or post data.

In this project or tutorial, we will use ASP.NET Web API to create a web API that returns a list of customers and depend on parameters we provide. We are getting results direct on browser and also display in web page with use of jQuery.

As we are developing this project in new framework following are the prerequisite:
Following is the requirement :

This example requires Visual Studio with ASP.NET MVC 4.

We can use any following:
    Visual Studio 2012
    Visual Studio Express 2012 for Web
    Visual Studio 2010 with ASP.NET MVC 4 installed.
    Visual Web Developer 2010 Express with ASP.NET MVC 4 installed.

If you are using Visual Studio 2010 or Visual Web Developer 2010 Express, you will need to install ASP.NET MVC 4 separately.

This project we developed in Visual Studio 2012.

Here is the step-by-step explanation of how to create Web API Project.

STEP 1 :