I posted this on the 'Hosting Open Forums', but didn't get any answer so I'll try again here...
I have a .NET 2.0 application that is hosted on Godaddy.com. When you setup your MySQL database, Godaddy supplies you with several connection strings, depending on the connector you wish to use (ODBC, OLEDB, and MySQL Connector .NET).
Since they provide a connection string for Connector .NET, I assume this means I could use this connector to access MySQL, and from what I read, doing so would be preferable to using ODBC or OLEDB.
I setup my page and plopped the MySql.Data.dll into my bin directory as suggested. Since Godaddy sets the trust level to medium on shared hosts, I got the following error (I've seen many people bring up this problem due to running under a medium trust level in .NET 2.0):
System.Security.SecurityException: That assembly does not allow partially trusted callers.
So, I did some research and it was suggested that if you add [assembly:AllowPartiallyTrustedCallers] to AssemblyInfo.cs in the MySql Connector .NET source, recompile, then use the new .dll, the trust issue will be resolved.
I did this and placed the new .dll in my /bin folder and although the original error went away, I now get the following error:
MySql.Data.MySqlClient.MySqlException: Unable to connect to any of the specified MySQL hosts ---> System.Security.SecurityException: Request for the permission of type 'System.Net.SocketPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed
For what it's worth, I am able to get the ODBC connector working (but intermittently 'lose connection during query' somewhat rarely, but enough to be a problem), but would prefer using the Connector .NET to access MySQL database. Anybody experience this and know what is going on, or how to fix this? Is using the MySQL Connector .NET just not possible with Godaddy.com? Thanks for any info.
Wyck