Connecting to a remote Oracle Database from Visual Studio - visual-studio-2010

How do I connect to an Oracle Database that is not hosted on my loacal machine from visual studio. There seem to samy many different ways that I am getting confused. What kind of information would I need about the host machine and the database before I can proceed? Would I use ODBC or something else? Please help me out with this because I have spent weeks trawling the web and its very confusing.

You can use ODP.net which is Oracle's official middleware for .net applications.
Once installed, you can connect to a server by using one of the various connection mechanisms that Oracle supports: EZConnect, LDAP, TNSNames...
Once you can access the databases, you can use VS's server explorer to access the db objects

Related

Connect to a MS Access database with SQL Developer

I have a Microsoft Access database (.accdb extension) that I would like to query with SQL developer version 19.4. Is this possible? and how do I achieve this?
I am not planning on migrating the database, I would just like to be able to query it with SQL (as I am not familiar with Access).
When I create a new connection I don't have the possibility to select Access in a tab with this version of SQL developer. When I use an older version it is there, but it doesn't support the extension of my Access database.
I found this as well: Connecting MS Access to Oracle SQLDeveloper
But the suggestions done there are not suitable for me unfortunately.
No it's not possible.
We used to offer this functionality via a odbc-jdbc bridge, but that went away with Java 7 I believe.
We've not built native support for an Access JDBC driver.
If you can find a copy of SQL Developer version 3, you can do what you want, out-of-the-box.
FYI, sql developer 4.0.3 also has Access and can open Oracle 19c.
You may need the driver:
Microsoft Access Database Engine 2016 Redistributable
Then you can create a Linked Server using your accdb file as source.

How to uninstall deprecated Oracle Data Provider?

I am trying to install Oracle Developer Tools for Visual Studio 2015 so that I can connect to a remote 11g database from SSRS/Visual Studio Projects in general, from my dev machine. When I go to the downloads page, I see this:
So I went to Visual Studio to determine whether I already had ODT, and found this:
However, I don't think I installed this ODP, and it just came with the Visual Studio installation. Is there a way to uninstall this provider, or am I OK to just install the new ODT over top? Lastly, as I did more research for this post I became a little more unsure: does ODAC include ODP.net?
Thanks.
Microsoft OLE DB Provider for Oracle and .NET Framework Data Provider for Oracle are providers from Microsoft, i.e. they are part of your Windows installation.
Indeed, they are deprecated from many years, however there is no reason to remove them. They are just two little DLL's.
It is no problem to install Oracle Provider for OLE DB and Oracle Data Provider for .NET (ODP.NET) from Oracle, the drivers from Oracle and the drivers from Microsoft do not interfere with each other.
Yes, ODAC (Oracle Data Access Components) is a collection of various drivers, ODP.NET, OLE DB, ODBC and a few more.
Just a note, unless you use the ODP.NET Managed Driver all drivers mentioned above require an Oracle Client installation, typically an Oracle Instant Client. I think the Oracle Instant Client is also included in the ODAC package.
Maybe have a look at this post to get a little overview: How to connect to Oracle 11 database from . net

What use as Database for developing asp.net vNext + Entity Framework 7 on OSX

I'm trying to set up my environment for developing asp.net vNext + Entity Framework 7 on my OSX.
Apparently, there is no provider for MySQL neither PostgreSQL yet. Thus, what can be used as database for developing on OSX?
What you folks have been doing for develop asp.net vNext on OSX? Or should I set up a Windows VM?
Any suggestion?
I've got even an open issue on Github on this topic.
Cheers
We will have a PostgreSQL and/or MySQL provider for EF7 (either delivered by our team or we'll work with a provider writer to help them build it). Work hasn't started on them yet though.
We haven't been focusing on EF7 on Mono at this stage, so there are likely some rough edges. We do have some folks who have successfully used it to connect to a remote SQL Server though.
To date, no RDBMS is supported on OSX for EF7.
Since (LocalDB)\v11.0 doesn't allow remote access and run on OSX/LNX, I've setup a SQLServer2012 Express and SQLServer 2012 Standard Edition hosted on a local Windows VM to establish a remote DB connection from my Visual Studio Code project.
From Visual Studio Code running on OSX, EF7 fails to successfully connect and interact with those local SQL Servers. In this instance, I was using the ASP.NET 5 Music Store example project: GitHub Source
Oh, and with all the SSL requirements, AZURE SQL Server is out of the question as an option.
Microsoft is heading in the right direction, we'll get there, but you're dealing with bleeding edge EF7 at the moment which is a complete reengineering from EF6.

Understanding Oracle database and ODAC installation

I want to use Oracle XE DB in my ASP.NET MVC project. I installed Oracle 11g XE on same machine where is VS running. Installation completed succesfully in C:\oraclexe. Everything as expected, i was able to connect to DB via Server Explorer using default .NET oracle data acces provider. But i want to use ODP.NET, so i installed ODP.NET + ODT in C:\app. Here is first confusing thing. Directory structure of C:\oraclexe..\server and C:\app..\client_1 is similar. Both have NETWORK\ADMIN folder where Tnsnames.ora resides. I understand that client is used to connect to database but:
Which Tnsname.ora will be used to connect to database?
Oraclexe also contains odp.net folder where Oracle.DataAccess.dll resides. If server installation come with odp.net why i need to install ODAC? Server Explorer in VS offered me ODP.NET drivers for connection only after ODAC install.
ODAC comes with Oracle Instant Client. When to use Oracle Client and when Oracle Instant Client? If i decide for Oracle Client and then i will install ODAC for connection, will it also install Instant Client which is part of ODAC?
Finally after installation of server and client, VS 2010 still does not offer me Oracle Providers in ASP.NET Configuration
Oracle XE is kinda special in that you typically install the server and client on the same machine. Logically, they are separate, but it does make things a bit harder to understand. For that reason, I will refer to other experts.
The folks at ORAFAQ have information about the TNSNAMES.ORA file. My personal strategy is to make all my TNSNAMES.ORA files the same, so there is no opportinity for confusion.
ODP.NET is for... .NET use, while ODAC is "native" (OLE) and provides more tools than you may have with just ODP.NET. Use whatever works for your needs.
For most cases, you would distribute the Instant Client. The Full Client is more useful for developers. Refer to the documentation and FAQs for details. You can have multiple clients on one machine, so I'm not sure what the problem is.
Restart the machine? Did you add the appropriate library/libraries to your environment?

Oracle Data Access Components and Visual Studio connection problems

I've created an empty console application in Visual Studio 2010 and I'm attempting to add an Oracle (10g XE ) Data Connection via the Server Explorer. I'm using Oracle ODP .NET as the connector and I get the following error:
ORA-12560: TNS: Protocol Adapter Error
I can access Oracle without issue via the web interface or a console, but continually get this generic connection error in VS. I'm using the default installation of Oracle XE and running it locally.
Any suggestion on how to get this set up correctly ? Every tutorial I find works on the understanding that this connection succeeds. As such I'm struggling to find where to begin to troubleshoot. I'm comfortable with VS2010, but new to the way Oracle does things with their DB.
EDIT 1
While troubleshooting I've found this only happens with the Oracle Data Provider for .NET. Using the .NET Framework Data Provider for Oracle I am able to successfully connect.
EDIT 2
I cleaned up everything and installed 11g XE and the ODAC tools again and continue to get the same message. I realize the error is somewhat generic, I'd be happy to post more information if anyone thinks it helpful. The database is run locally, I can't imagine what kind of 'configuration' an express database would even need...
EDIT 3
The ODAC tools appear to install a 'production' version of Oracle 11 instead of the BETA version that I installed first. Almost appears as if the tool is installing another database ? I also appear to have two ORACLE_BASE locations and two TNSNAMES in what appear to be very similar folder hierarchies. Perhaps a more straightforward tutorial is the answer, Oracle's isn't very descriptive.
Oracle 10g XE seemed to be the problem. A full install of 11g (Full, not Express) took care of the problem entirely.
From here:
Possible fixes for the TNS-12560
include:
Get the latest patches for the SQL*Net client software.
Check your $ORACLE_HOME and $Path variables.
Check File permissions on the PC client.
Ensure that TNS_ADMIN is set correctly.
Check for firewall issues.
Check that the Windows database service is started. Verify teh
ORACLE_SID parameter is set correctly
in the registry.
Wow. I finally got this syntax to work.
I'm a Sql Server guy. I used Oracle back in the da day.
But I'm trying to do some Entity Framework and I said "You're not going to bed until you get Visual Studio 2012 and a edmx file to talk to Oracle.
Geeze.
Here is what I came up with:
Data Source:
Oracle Database (Oracle ODP.NET)
Data Source Name:
localhost:1521/orcl
User Name:
SYSTEM
change the default data source name to localhost.

Resources