Apologies if this is a bit of a vague question; I'll try to word it as appropriately as I can.
Basically I have a C++ application that currently runs off of a back-end MSSQL (SQL Server 2014) database. To ease in database communication and building the entity model we assembled our own set of C++ classes that wrap up the native ADO.NET calls; we have created it in such a way that the developer simply needs to supply details for a connection string and it is assembled as part of the connection method like so:
string.Format(_T("DRIVER=SQL Server;SERVER=%s\\%s;UID=%s;PWD=%s;DATABASE=%s"),string,strConnInstance,strUser,strPassword,strDatabase);
We now have a requirement to read from an oracle database, and we wonder if we can use the same connection libraries. I assume that we will need to tweak the connection string (e.e.g the driver would need to read something different). I believe I have read that Oracle connection can be faciliated through use of an ODBC driver? Would it simply be a case of installing the relevant driver (if so, which?) and changing the "Driver" argument in the connection string (if so, to what?).
If it is not quite this simple, is there any other way it can be done, or are we looking at a redevelopment?
Thanks in advance!
The answer is yes you can use ADO.NET to connect to Oracle. There's plenty of people out there on stack overflow already doing it...
https://stackoverflow.com/search?q=oracle+ado.net
Oracle has a page for the db provider...
http://www.oracle.com/technetwork/topics/dotnet/index-085163.html
Microsoft has a page talking about it...
https://msdn.microsoft.com/en-us/library/77d8yct7(v=vs.110).aspx
Oracle even has examples using Entity Framework...
http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/dotnet/EntityFrameworkOBE/EntityFrameworkOBE.htm http://www.oracle.com/technetwork/issue-archive/2011/11-sep/o51odt-453447.html
There's heaps of resources out there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With