DataBinding DataSet to GridView yields infinite loop
<p>I am attempting to bind a GridView to a DataSet, but it throws a Stack overflow error. When I debug it, it runs to the DataBind line just fine (it seems like its getting the right records from the server and everything), but after executing the DataBind, it jumps to the top of the method and reruns the entire method, which results in an stack overflow.</p>

<p>I can't understand why this isn't working. I've done something very similar with a DataTable before and it worked fine.</p>

<p>Here is how I'm binding</p>

<pre><code>    public void CreateGrid(String str)
    {
    try
    {
        sqlConnection = new SqlConnection();
        sqlConnection.ConnectionString = ConfigurationManager.ConnectionStrings["MY_CONNECTION_STRING"].ConnectionString;
        sqlConnection.Open();
        DataSet dt = new DataSet();
        SqlDataAdapter adapter = new SqlDataAdapter(str, sqlConnection);
        adapter.Fill(dt);
        sqlConnection.Close();
    }
    catch (Exception ex)
    {
        Console.WriteLine(ex.GetType().Name + ":" + ex.Message);
    }
    if (dt.Tables.Count &gt; 0)
    {
        Grid.DataSource = dt;
        Grid.DataBind();
    }
    }
</code></pre>

<p>And here is my HTML part</p>

<pre><code>&lt;asp:GridView runat="server" ID="Grid" AutoGenerateColumns="false" 
 OnDataBinding="RebindGrid" AllowPaging="True" PageSize="10" AllowSorting="True" CellPadding="5" 
 OnPageIndexChanging="Grid_PageIndexChanging"
 OnSorting="Grid_Sorting"
 Width="100%" CssClass="mGrid"&gt;
    &lt;Columns&gt;
        &lt;asp:BoundField DataField="ID" ItemStyle-Width="0%" 
            HeaderText=""  Visible="false" SortExpression="ID"/&gt; 
    &lt;/Columns&gt;  
&lt;/asp:GridView&gt;
</code></pre>
