Search code examples
c#oracleasp.net-web-apisystem.data.oracleclient

Issue using the Oracle Command Parameters


Trying to create a Web API which queries the Oracle DB which receives the input as array of String.So trying to add Command Parameters

I added the following references System.Data.OracleClient.dll also,

using Oracle.ManagedDataAccess.Client;
using Oracle.ManagedDataAccess.Client.OracleParameter;
using System.Data.OracleClient;
using System.Data.OracleClient.OracleParameter;

But getting error as below enter image description here

`A using namespace directive can only be applied to namespaces; 'Oracle.ManagedDataAccess.Client.OracleParameter' is a type not a namespace

A using namespace directive can only be applied to namespaces; 'System.Data.OracleClient.OracleParameter' is a type not a namespace `


Solution

  • You are trying to use both Oracle's Oracle client (Oracle.ManagedDataAccess.Client) and Microsoft's Oracle client (System.Data.OracleClient). You should pick one of them. However, I think the Microsoft one is deprecated in more recent .Net Framework releases so you're probably better off with Oracle's implementation.