Note that there are some explanatory texts on larger screens.

plurals
  1. PO"Both DataSource and DataSourceID are defined" error using ASP.NET GridView
    text
    copied!<p>"Both DataSource and DataSourceID are defined on 'grdCommunication'. Remove one definition."</p> <p>I just got this error today, the code has been working until this afternoon I published the latest version to our server and it broke with that error both locally and on the server. I don't use "DataSourceID", the application reads database queries into a datatable and sets the datatable as the DataSource on the GridViews. I did a search in Visual Studio, searching the entire solution and the string "DataSourceID" does not appear in even 1 line of code in the entire solution. This is the first thing that freaked me out. </p> <p>I figure it had been working yesterday, so I reverted the code to yesterday's build. The error was still there. I kept going back a build, and still the issue is there. I went back a month, I am still getting the same error. This application was working fine this morning? There has really been no code changes, and no where in the application is the DataSourceID EVER set on any of the gridviews. Has anyone ever seen anything like this at all??</p> <p>How can I get that error if DataSourceID is never set... and the word "DataSourceID" is not in my solution? I just did a wingrep on the entire tree doing a case insensitive search on datasourceid.... pulled up absolutely nothing. That word is absolutely no where in the entire application. </p> <pre><code> &lt;asp:GridView ID="grdCommunication" runat="server" Height="130px" Width="100%" AllowPaging="true" &gt; ... standard grid view column setup here... &lt;/asp:GridView&gt; // Code behind.. to set the datasource DataSet dsActivity = objCompany.GetActivityDetails(); grdCommunication.DataSource = dsActivity; grdCommunication.DataBind(); </code></pre> <p>// Updated: removed some confusing notes. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload