I have a problem connecting to my Oracle database from my VB.NET application. I am using the System.Data.OracleClient
namespace. When calling connection.Open()
with specifying the correct connection string (see below), I get the error ORA-12541: No TNS listener
. I have tried following things:
- Installing the Oracle client on my development machine
- Checked the listener with
lsnrctl
on my database machine – listener is running and ready - Tried
tnsping
from the development machine to the database machine – it succeeded
I have tried the following connections, both failing with the same issue:
Data Source=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.127)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SID = xe)));Persist Security Info=True;User ID=user;Password=pwd;
Data Source=XE;User ID=user;Password=pwd
where XE
is defined in tsnames.ora
as follows:
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.127)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID = xe)
)
)
As mentioned above, both tnsping 192.168.10.127
and tnsping XE
succeed.
I am using a Oracle 21c Database, with .NET-Framework v4.8.
Connection to the database via sqlplus
command does work as well.