As
jim lahey said "You don't need to create a JSON service in MVC. You just need to return a JsonResult from your controller action method"
The link below will show you how to :
"Building an MVC 3 App with Model First and Entity Framework 4.1"
That helps you, connect to sql server db throw Entity Framework
Then make a Blog Controller contains the code below
public class BlogController : Controller
{
private BlogModelContainer db = new BlogModelContainer();
public JsonResult Index()
{
IList<blog> blogs = db.Blogs.ToList();
return Json(blogs, JsonRequestBehavior.AllowGet);
}
}
After you call
Index Action From
Blog Controller (/Blog/Index/) you will get something like this:
[{"Id":1,"Title":"Title 1","BloggerName":"Blogger Name 1"},{"Id":2,"Title":"Title 2","BloggerName":"Blogger Name 2"},{"Id":3,"Title":"Title 3","BloggerName":"Blogger Name 3"},{"Id":5,"Title":"Title 5","BloggerName":"Blogger Name 5"},{"Id":7,"Title":"Title 7","BloggerName":"Blogger Name 7"},{"Id":8,"Title":"Title 8","BloggerName":"Blogger Name 8"},{"Id":10,"Title":"Title 1","BloggerName":"Blogger Name 10"}]