---
title: "How to Bind GridView in MVC4 with Database"  
description: "How to Bind GridView in MVC4 with Database"  
author: "Anonymous User"  
published: 2015-11-24  
updated: 2015-11-24  
canonical: https://www.mindstick.com/forum/33634/how-to-bind-gridview-in-mvc4-with-database  
category: ".net"  
tags: ["c#", "mvc", "mvc3", "mvc2", "mvc4", "mvc5"]  
reading_time: 1 minute  

---

# How to Bind GridView in MVC4 with Database

I want to use [GridView](https://www.mindstick.com/articles/873/update-delete-edit-gridview-in-asp-dot-net) in [mvc](https://www.mindstick.com/forum/155803/define-cache-profile-in-mvc) how to use please help me.

## Replies

### Reply by Anonymous User

```
@model IEnumerable<ForumMVC.Employee> @{      ViewBag.Title = "Bind Gridview with Database";      WebGrid grid = new WebGrid(Model);  }    <h2>Bind GridView in MVC4 with Database</h2>  @grid.GetHtml(columns: new[]    {      grid.Column("Emp_ID"),      grid.Column("Emp_Name"),      grid.Column("Emp_Sal") }   )
```

```
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;using System.Threading.Tasks;using System.Diagnostics;using ForumMVC;namespace ForumMVC.Controllers{    public class HomeController : Controller    {        forumEntities db = new forumEntities();        public ActionResult Index()        {            IEnumerable<Employee> LIst = db.Employee.ToList();            return View(LIst);        }             }}
```


---

Original Source: https://www.mindstick.com/forum/33634/how-to-bind-gridview-in-mvc4-with-database

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
