Tonight I was trying to setup and use the ASP.NET GridView with the MySql Connector to allow for easy editing of code table for a site I'm creating. The framework I'm going against for this project is the .Net Framework 4.0 (I downloaded the source code for the MySql connector and I compiled against 4.0 so I would have a native library that didn't have to also have 3.5 present).
Anyway, the above error is fixed by adding the following to the web.config:
<system.data>
<dbproviderfactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySql Data Provider" invariant="MySql.Data.MySqlClient"
description=".Net Framework Data Provider for MySql"
type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data" />
</dbproviderfactories>
</system.data>
For reference, the bones of the SqlDataSource in the ASP.Net markup looks something like this:
<asp:SqlDataSource ID="dsMySql" runat="server"
ConnectionString="<%$ ConnectionStrings:MySqlMain%>"
ProviderName="<%$ ConnectionStrings:MySqlMain.ProviderName%>"
SelectCommand=""
UpdateCommand=""
DeleteCommand=""
InsertCommand="">
</asp:SqlDataSource>