Tuesday, 6 February 2018

Oracle.ManagedDataAccess - accessing Oracle from .Net without having to install any Oracle client


"ODP.NET, Managed Driver is a 100% native .NET code driver. No additional Oracle Client software is required to be installed to connect to Oracle Database."

Add this nuget package:




Stuff gets added to config; configure connection

Have had a problem when multiple connection strings with them not reading from the aliased data source. Can skip the datasource config elements and put it directly into the connection string.

Accessing the connection string as per standard



Use the OracleCommand same way as SqlCommand. To issue command (e.g. update):

or to read data (e.g. select):


Parameters in the query are prefixed with colon:


NOTE: Ensure that the params added in the code (e.g. using the command.Parameters.Add) are done in the same order as they occur in the query. Even though a name is specified when adding a parameter, by default that is ignored.

No comments:

Post a Comment