I am trying to connect to a remote oracle database with my c# application, but when it comes to the oracleconnection.open() it exits with
AccessViolationException was unhandled - Attempted to read or write protected memory. This is often an indication that other memory is corrupt
my connection string is key="oracleconnectionstring" value="Data Source=XYZ; password=mypassword; User ID=myuserid" in the app.config file.
the tnsnames.ora is
XYZ =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = HostName)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = XYZ)
)
)
If I try to connect via Sql Developer it connects without any problems, if I try SqlPlus it just crashes (Sql*Plus has stopped working) and if I try with VS it gives me that strange error.
what can it be?
EDIT: if I try to tnsping xyz it returns OK (100ms);
oracleconnection = new OracleConnection(oracleconnectionstring); oracleconncetion.Open();