0

I have 2 laptops (A and B) on the same local networks (Wi-Fi).

I have installed Oracle database 12c r2 on laptop A.

In laptop A I have created a VB.NET application with Visual Studio 2017 that can connect to the Oracle database.

The app works fine on laptop A. It connects to the database and this is my app form, and the connection string I use (192.168.20.98 is my laptop A IP Address):

App working screen, from laptop A

oracle_connection = New OracleConnection(
    "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=" & protocol.Text &
    ")(HOST=" & host.Text & ")(PORT=" & port.Text &
    ")))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=" & db_name.Text &
    ")));User Id=" & user_id.Text & ";Password=" & pswd.Text)

I've also edited my listener.ora and tnsnames.ora located in C:\app\mustafa\product\12.2.0\dbhome_1\network\admin as the following:

listener.ora:

# listener.ora Network Configuration File: 
C:\app\mustafa\product\12.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\app\mustafa\product\12.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = 
"EXTPROC_DLLS=ONLY:C:\app\mustafa\product\12.2.0\dbhome_1\bin\oraclr12.dll")
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.20.98)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)

tnsnames.ora:

# tnsnames.ora Network Configuration File: 
C:\app\mustafa\product\12.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

DB1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.20.98)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = db1)
)
)

LISTENER_DB1 =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.20.98)(PORT = 1521))


ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)

I've edited my Oracle home folder permission to give authenticated users the full access.

So when I move my app to the laptop B and run it to connect to the database on laptop A I got this error:

System.Data.OracleClient requires Oracle client software version 8.1.7 or greater.

Error screen from laptop B

I can't find any solution. Does it require the Oracle database 12c r2 to be installed on my laptop B too?

Pedro Gaspar
  • 777
  • 8
  • 35
mustafa-naeem
  • 37
  • 1
  • 10
  • No, it isnt the entire oracle client software that is required. It needs just enough of oracle client interface to be able to connect to your server. Do as the stacktrace asks you to - i.e. install oracle client interface. – shahkalpesh Nov 11 '18 at 17:53
  • @shahkalpesh I'm just feel little Confused , i have to just install oracle client interface on the B laptop right ? could you please give me the exact download link ? there are many download links in oracle website and very similar thinks to download – mustafa-naeem Nov 11 '18 at 18:27
  • Having two computers connected to the same wifi doesn't mean you have a local network. Try to ping laptop A from laptop B using `ping 192.168.20.98` command and tell us what was the result. – Pedro Gaspar Nov 11 '18 at 19:05
  • hello @PedroGaspar I ping from B to A and get 0% packets loss – mustafa-naeem Nov 11 '18 at 19:18
  • So you probably have do to do what @shahkalpesh suggested and install just OracleClient on laptop B. Problem is that System.Data.OracleClient is [obsolete](https://learn.microsoft.com/en-us/dotnet/api/system.data.oracleclient.oracleconnection) for some time now, so it's better for you to use ODP.NET from Oracle itself. Take a look at this [3 steps migration article](https://www.oracle.com/technetwork/topics/dotnet/msoc-migration-337643.html). – Pedro Gaspar Nov 11 '18 at 19:27
  • hi @PedroGaspar thanks for your replying --- is ODP.NET will make me develop an application that can run on the B laptop without the need for OracleClient installed on it ? i saw a youtube video about it and it's very cool – mustafa-naeem Nov 12 '18 at 07:59
  • Actually I've never worked with Oracle nor OracleClient nor ODP.NET, but, as I understand It, yes, ODP.NET will subsbitute System.Data.OracleClient and you won't need it anymore. I guess you'll just need to install ODP.NET, like any third-party runtime library. – Pedro Gaspar Nov 12 '18 at 09:12
  • @PedroGaspar thanks you very much your a life saver – mustafa-naeem Nov 12 '18 at 09:18
  • @mustafa987, I found more information about the problem, take a look at my answer. – Pedro Gaspar Nov 12 '18 at 15:57
  • Possible duplicate of [System.Data.OracleClient requires Oracle client software version 8.1.7 or greater](https://stackoverflow.com/questions/7832208/system-data-oracleclient-requires-oracle-client-software-version-8-1-7-or-greate) – Pedro Gaspar Nov 12 '18 at 16:15
  • Possible duplicate of [Error System.Data.OracleClient requires Oracle client software version 8.1.7 or greater when installs setup](https://stackoverflow.com/questions/19354015) – Pedro Gaspar Nov 12 '18 at 18:10

1 Answers1

1

The System.Data.OracleClient namespace is the .NET Framework Data Provider for Oracle, but still it needs the Oracle Client software installed on the target machine:

Oracle and ADO.NET | Microsoft Docs

The .NET Framework Data Provider for Oracle provides access to an Oracle database using the Oracle Call Interface (OCI) as provided by Oracle Client software.

And:

.NET Framework Data Providers | Microsoft Docs

For Oracle data sources. The .NET Framework Data Provider for Oracle supports Oracle client software version 8.1.7 and later, and uses the System.Data.OracleClient namespace.

But, as stated on the docs also:

Note

The types in System.Data.OracleClient are deprecated. The types remain supported in the current version of.NET Framework but will be removed in a future release. Microsoft recommends that you use a third-party Oracle provider.

So, it's better to use the Oracle Data Provider for .NET (ODP.NET), instead of the deprecated System.Data.OracleClient. Here there's a 3 steps migration article to help in the proccess.

Anyway, both the Microsoft or Oracle data providers will still require the Oracle Client software installed on the target machine. The Oracle Client software is named Oracle Instant Client and can be found here.

If you already have the Oracle Instant Client installed on the target machine, you could try one of these (that I think the question's author already did):

Pedro Gaspar
  • 777
  • 8
  • 35
  • 1
    hi @PedroGaspar, sorry for late replying because being busy watching tons of programming tutorials however I've changed to ODP.NET and can say it's very nice, however, thank you very much for this great information you provided for me – mustafa-naeem Dec 10 '18 at 09:42