Prasad Bolla's SharePoint Blog

Click Here to go through the Interesting posts within my Blog.

Click Here to go through the new posts in my blog.

Thursday, September 03, 2015

Binding a Gridview using Entity Framework from SQL Server

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class BindGridView : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack)
        {
            ContactsDataContext db = new ContactsDataContext();
            dgvContacts.DataSource = db.Contacts1;
            dgvContacts.DataBind();
        }
    }
}

No comments:

Post a Comment