[thelist] [.NET] Multi-Database Programming

Joshua Olson joshua at waetech.com
Mon Nov 8 13:17:39 CST 2004

Hi list,

I'm developing a website that I expect to be used with SQL Server, MySQL,
and Oracle.  A software setting allows them to dictate which database to
use.  I've consolidated all the database utilities (ie, opening a connection
object, command object, etc) into a few multi-purpose function.  Ie,
GetConnection will create a connection string and instantiate the correct
connection object per the settings.

Ok, so here's the problem..

As soon as the function that references MySQL, even if the code-path doesn't
allow for the code to be executed, the system tries to load up the assembly.
If the assembly isn't installed on the client machine, then every blows up.
The error being in this case:

File or assembly name Oracle.DataAccess, or one of its dependencies, was not

I've confirmed that the code that actually tries to create the OracleClient
object is never invoked.  And, I put some tracing at the top of the method
and confirmed that the function doesn't execute even the first line.

Any help would be appreciated.

Joshua Olson
Web Application Engineer
WAE Tech Inc.

More information about the thelist mailing list