ASP.Net 2.0 and MySQL not working

I am trying to get a new application that is an ASP.Net 2.0 app connecting to a MySQL DB. It works fine for the developer on her local machine connecting to the DB here on JH servers. It also works fine on the server it is moving from. However, on here, we keep getting this error:

OdbcException (0x80131937)]
System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode) +35
System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection connection, OdbcConnectionString constr, OdbcEnvironmentHandle environmentHandle) +131
System.Data.Odbc.OdbcConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +98
System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +27
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +47
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.Odbc.OdbcConnection.Open() +37
site_public.Page_Load(Object sender, EventArgs e) +51
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Control.LoadRecursive() +131
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061



Any ideas? It's set up trying to use a DSN as well as connecting directly to the DB in the connection string, and the error is the same.

Thanks,
-Ben
 
i have the MySQL.NET connector installed, is there any way you could use this istead? ODBc is slow and I suggest no one use it :D
 
You don't happen to have any examples or could point me to the connector you're talking about? Is it just a different connection string?
 
We have the code using the new assemblies, but we're now getting another issue:

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Could not load file or assembly 'MySql.Data, Version=1.0.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Line 22: <add assembly="MySql.Data, Version=1.0.9.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>

Some of the news groups point this to be a version mismatch of some kind. Can you shed any light on how to correct this?

Thanks,
-Ben
 
I think this error only occurs if the assembly version in your Bin directory does not match the one you're attempting to load in the Web.config.
It should also occur on any other machines with the same files, unless that machine happens to have the 1.0.9.0 version installed in the GAC (global assembly cache).

I would recommend against relying on the GAC to supply the required version of the assembly in a shared hosting environment. 1.0.9 is the latest version, so you should be ok by downloading it here and putting the DLLs in your website's Bin directory.
 
Thanks for the insight, I believe the developer has the dll in the bin directory, but it doesn't appear to be working quite right. I'll forward this on and see what happens.

-Ben
 
Still not working. The developer is getting very frustrated. Is there any reason why using regular ODBC through a DSN doesn't work? There has to be some sort of error logs that shows either a permissions issue or something.

Stephen, would you be able to please look into this for me and let me know what is going on? There is a ticket in support under #ENX-36689-782.

Again, the hard part that I don't understand is that the code works great on another server with another provider. Windows 2003 with IIS6. It just refuses to run on JH servers.

Thanks,
-Ben
 
Also, the error since removing the assemblies has changed to this:

BC30456: 'CreateResourceBasedLiteralControl' is not a member of 'ASP.site_public_master'.

The only solutions I've been able to find online is that the namespace is named for a reserve name, but it doesn't look to be the case in this instance.
 
I don't have time to look into it right now, but that sounds like you might be missing some resources file(s). Have you checked if all the App_Data and/or *.resx files are uploaded?
 
I replied to you via mail and gave you an update, and will be checking this today.
 
Subspace, I believe all the files have been uploaded. Even doing a straight copy from the old server to the JH servers, and modifying the connection strings just does not work. That was where we got the ODBC errors.

Stephen, thank you for the update. I will be looking forward to hearing what you see on the server log files.

Thanks,
-Ben
 
Making some progress, its a permissions issue for sure, on the files themselves. I am trying to find what file is being called and ctually having to set up a test enviroment as filemon even with filtering is a bit hard to follow when I don't know exactly which file is denied permissions, and the files are accessed so quickly in a shared environment it is not easy to trace down each file access even in a 3 second span, so I am working on a VPS to emulate what is happening.
 
Stephen, the site has been redeployed now. Please note that it appears that the server is trying to serve up the "index.html" file instead of the "default.aspx" by default. Not related to these issues, but something to note.

Please let me know what you find out.

Thank you,
-Ben
 
Just wanted to drop a note on this for everyone else. Thanks for Stephen's efforts, the site is now working with ODBC. Great work Stephen! Definitely glad I chose this place for my hosting services.
 
Hello,

the mysql data dll must be recompield to work, that is without a doubt, the only way to do without a recompile is with the odbc.net, it will work without problems and mysql forums suggest it for asp.net in medium trust.

I am working over the next 2 days to write up a tutorial on recompiling the mysql.data.dll as well.
 
Back
Top