I thought I would post this here in hopes that it helps out others that come across this problem in the future.
I use GoDaddy as a host, and since I get 25 MySql databases with my hosting package and only 2 MSSQL databases, I wanted to find a way to properly utilize those MySql databases with ASP.NET. In the past, I have avoided the use of databound controls such as GridView when using MySql databases because, to be brutally honest, it just never worked very well. By "very well" I mean it was a lot of extra work to make it happen, and when you're pressed for time, that's never work you want to actually be doing.
Last evening I did some Googling and came across some information that allowed me to hookup databound controls, such as GridView, using a MySql database and keeping ALL of the features of those databound controls (such as paging data, sorting, etc). This is great news!
First things first, you want to get yourself a copy of the latest MySql Data Connector (Connector .NET) on the mysql.com site. I grabbed 6.0.4.0 last night from here:
http://dev.mysql.com/downloads/connector/net/6.0.html
Once you've installed the connector (or extracted it), find the MySql.Data.dll file and drop it in the \Bin folder of your ASP.NET web project.
Next, you need to edit your web.config file and add the following information.
Place this just after the closing of your "Connection Strings" section:
<system.data>
<DbProviderFactories>
<add name="MySQL DataProvider"
invariant="MySql.Data.MySqlClient"
description=".NET Framework Data Provider for MySql"
type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.0.4.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D" />
</DbProviderFactories>
</system.data>
Place this inside your "Assemblies" section.
<add assembly="MySql.Data" />
That should do it for your local development efforts (there is more below for GoDaddy specific setups). You can now use <asp:SqlDataSource> with your MySql database, but just be sure to provide your "ProviderName" to the control as well or else it will attempt to use the MSSQL provider type. ex:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
ProviderName="<%$ ConnectionStrings:ConnectionString.providerName%>">
// etc..
</asp:SqlDataSource>
No, on to GoDaddy specific web.config modifcations.
GoDaddy requires a simple change to the web.config file in order to support the MySql Data Connector:
<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, Version=6.0.4.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D" />
</DbProviderFactories>
</system.data>
(NOTE the <remove /> addition)
And that's it! You can now use your local (or GoDaddy) MySql databases with ASP.NET and enjoy the databinding features you're used to with MSSQL databases. :)
One final comment, here are some connection string examples for those searching for how to setup their MySql connection strings in web.config:
GoDaddy (the database login is always the same name as the database itself):
<add name="ConnectionString" connectionString="Data Source=MyDbLogin.db.4112315.hostedresource.com;User Id=MyDbLogin;Password=MyDbPassword;connect timeout=10;Database=MyDbLogin;Pooling=false;" providerName="MySql.Data.MySqlClient" />
Local Development on a virtual server:
<add name="ConnectionStringDev" connectionString="Data Source=localhost;User Id=MyDbLogin;Password=MyDbPassword;connect timeout=10;Database=MyDatabase;Pooling=false;" providerName="MySql.Data.MySqlClient" />
Done!
I hope someone benefits from all of this! I spent about 3 hours last night getting this all to work properly, so I hope it can save someone else some time now that it's documented.