title: DataBind() in C#
body: <p>I am fairly new to Entity framework as well as LINQ. I have used DataGridView before and to set the datasource to it</p>
  
  <pre><code>DataGridView1.datasource=dt; // dt=datatable
  </code></pre>
  
  <p>was enough. But while reading ASP.Net book they have given the code using Entity Framework as</p>
  
  <pre><code>using (PlanetWroxEntities myEntities = new PlanetWroxEntities())
  {
      var allGenres = from genre in myEntities.Genres
      orderby genre.Name
      select new { genre.Name, genre.Reviews };
      GridView1.DataSource = allGenres;
      GridView1.DataBind();
  }
  </code></pre>
  
  <p>Why is this <code>DataBind()</code>is used in the end. I have seen the MSDN document for<code>DataBind()</code>which says "(It) Binds a data source to the invoked server control and all its child controls."</p>
  
  <p>And if I remove it, I get an error as "The ObjectContext instance has been disposed and can no longer be used for operations that require a connection."</p>
  
  <p>So I was just confused that what is this<code>DataBind()</code>actually does? I have seen some people using DataBind for DataGridView also, and I am not sure why?</p>
  
  <p>Thanks.</p>