Monday, June 29, 2009

ASP.NET 3.5 Sample Application of LINQ, WFC, JSON, and AJAX

Introduction

The purpose of this article is to provide a working sample of a new .NET technologies. This sample contains a working example of calling a WCF service from AJAX and using the results in JavaScript via JSON. It will also provide you with an example of how to call a Stored Procedure in LINQ. This sample uses the Northwind database that you can download from Microsoft. In order to run the sample, you must change the connection string "NorthwindConnectionString" in the web.config to point to your copy of Northwind. The SearchCustomers Stored Procedure code is provided in a text file in the solution.

Background

Often, developers are too busy actually working on applications to take the time to learn all of the new tools provided by Microsoft. I have seen some examples of LINQ, WCF, and JSON, but I wanted to put a simple example of each in one place.

An entity class to use with JSON

The class below is an entity that will be accessible in JavaScript. In order to access the properties via JSON, you need to add the appropriate attributes.


See full detail: http://www.codeproject.com/KB/aspnet/WelcomeToTheNew.aspx

No comments: