I know exactly what is your problem because I had this one before, actually the problem isn't in your code its about the connection you use for connecting your Mysql database, simply you need to use ODBC connection to connect to your database and here is an example of how to do so
<connectionstrings>
<add name="YourConnectionStringName" connectionstring="DRIVER={MySQL ODBC 3.51 Driver};SERVER=.;PORT=3306;DATABASE=YourDatabaseName;USER=YourDatabaseUsername;PASSWORD=YourPassword;OPTION=0;" providername="System.Data.Odbc" />
</connectionstrings>
add the previous code while changing it to work with your database in the System.web section in your website configuration file.
NOTE: You may need to change your commands to work with the ODBC connection