title: The DataSourceID of 'GridView1' must be the ID of a control of type IDataSource
body: <p>Why i am getting following error ?
  i can see data when i did a test run query !</p>
  
  <pre><code>Server Error in '/' Application.
  The DataSourceID of 'GridView1' must be the ID of a control of type IDataSource.  A control with ID 'MyDataSource' could not be found.
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
  
  Exception Details: System.Web.HttpException: The DataSourceID of 'GridView1' must be the ID of a control of type IDataSource.  A control with ID 'MyDataSource' could not be found.
  
  Source Error:
  
  An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
  
  Stack Trace:
  
  [HttpException (0x80004005): The DataSourceID of 'GridView1' must be the ID of a control of type IDataSource.  A control with ID 'MyDataSource' could not be found.]
     System.Web.UI.WebControls.DataBoundControl.GetDataSource() +8556294
     System.Web.UI.WebControls.DataBoundControl.ConnectToDataSourceView() +37
     System.Web.UI.WebControls.DataBoundControl.OnLoad(EventArgs e) +19
     System.Web.UI.Control.LoadRecursive() +50
     System.Web.UI.Control.LoadRecursive() +141
     System.Web.UI.Control.LoadRecursive() +141
     System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
  
  
  Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927 
  </code></pre>
  
  <p>Below is my source :</p>
  
  <pre><code>&lt;%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="WebApplication1.WebForm1" %&gt;
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
  &lt;head runat="server"&gt;
      &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
      &lt;div&gt;
        &lt;asp:Label ID="Label1" runat="server" Text="Label"&gt;&lt;/asp:Label&gt;
      &lt;/div&gt;
      &lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
          DataSourceID="MyDataSource"&gt;
          &lt;Columns&gt;
              &lt;asp:BoundField DataField="Colum1" HeaderText="Colum1" 
                  SortExpression="Colum1" /&gt;
              &lt;asp:BoundField DataField="Column2" HeaderText="Column2" 
                  SortExpression="Column2" /&gt;
              &lt;asp:BoundField DataField="Column3" HeaderText="Column3" 
                  SortExpression="Column3" /&gt;
          &lt;/Columns&gt;
      &lt;/asp:GridView&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>