top of page

C#

Public·1 member

How to dynamically load Oracle.ManagedDataAccess.Client using C#


When a .NET DLL library depends on an ADO.NET data provider, we can either reference the ADO.NET provider in our DLL project or we can use reflection in C# to dynamically load the data provider and not reference the provider assembly. The project in which the DLL is being used may prefer using an Oracle provider, a MySQL provider or a SQL Server provider, and therefore, there is a need to dynamically use the preferred provider.


The code below implements such a requirement.


Alternate sample code that uses the Instance field to implement the above requirement


31 Views
bottom of page