Reputation: 600
I'm trying to connect to oracle database using server explorer in visual studio 2015. Every time I try to create a new connection through Add Connection dialog box, the drop down menu in front of "Connection Type:" (on the dialog box) only gives me TNS and EZConnect options. No option is listed for connecting to Oracle through LDAP. I have been asked to connect only through LDAP (no TNS or EZCOnnect).
My sqlnet.ora file has these contents
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME, LDAP)
in it.
And ldap.ora has these contents
DEFAULT_ADMIN_CONTEXT = "dc=something1,dc=something2,dc=com"
DIRECTORY_SERVERS= (x.y.net:somenumber:somenumber,a.b.c.net:somenumber:somenumber,p.q.r.net:somenumber:somenumber)
DIRECTORY_SERVER_TYPE = OID
Oh actually I copied these files over to where tns.ora file sits by default (if I select tns as connection type in Add Connection dialog box that's when I come to know about tns file's default location).
I'm not sure do I need to connect to Oracle through LDAP by adding some kind of configuration in web.config file or something. And if so then how can I connect to oracle (using server explorer, remember no TNS or EZConnect) and create tables in the database using Visual Studio UI. I'm not supposed to use any other tools for creating tables other than Visual Studio UI (UI which is meant for creating all database objects after we establish a connection to the database using server explorer).
And the other thing which I'm totally confused about is that up top on the dialog box under "Data Source:" I see it's written "Oracle Database (ODP.NET, Managed Driver)" and a change button to right of it.How come Visual Studio knows where the odp.net driver is lying on the machine (hence shows it in a drop down menu when change button is clicked).However I installed and uninsatlled odp.net unamanged and managed drivers (both 32 and 64 bit versions) many a times in the project that I have opened the Add Connection dialog box in. Even when I uninstalled all the versions of unmanaged/managed drivers and clicked on the change button I could still see Oracle Database (ODP.NET, Managed Driver) in the drop down, how is that possible since all the odp.net managed or unmanaged drivers has been uninstalled.
It's getting cumbersome to get my head around all this. Any help will be highly appreciated.
Note: I installed and uninstalled odp.net drivers using nuget package manager console in Visual Studio.
Upvotes: 0
Views: 1265
Reputation: 59563
I assume TNS
and EZConnect
just defines the type connection string but it does not tell you how to resolve the your TNS name. It can be resolved by tnsnames.ora
file or by LDAP server. Nowadays, ONAMES
is not used anymore.
Do you have an environment variable TNS_ADMIN
defined? ODP.NET Managed Driver does not read the registry where TNS_ADMIN
is usually defined.
Check you GAC (Global Assembly Cache) with tool gacutil.exe
is you see any Oracle.ManagedDataAccess.dll
. Perhaps the Uninstaller did not remove it from there.
Did you try to connect to the database by code, instead of clicking dialog boxes?
Upvotes: 0