.net oracle connection
.net oracle connection

I am trying to connect to an oracle database in my .net project. I am getting an error in the line
using (var db = new Database(settings.DbType, settings.DbConnection))
error is: unable to find the requested .net framework data provider. it may not be installed
do I need add a reference to something?
This discussion has been closed.
Answers
This is .NET core I guess? Unlike .NET Framework (which usual a global machine configuration) you need to tell .NET Core to register database handlers. There is some information about that in our documentation here.
Allan
no, I am using .NET framework. Do I need to use .NET core?
Oh - if you are using .NET Framework I would have expected it to just work. Assuming you have the Oracle .NET driver installed on your system? What version of it are you using?
Allan
I was trying to use Oracle.DataAccess but had issues with the project not loading. Then I switched to Oracle.ManagedDataAccess.dll. but still getting that error above.
Yes, the
ManagedDataAccess
client is the one we use by default.What version of that library have you got referenced in the project?
Thanks,
Allan
4.122.1.0
I tried Oracle.DataAccess.EntityFramework 6.122.1.0 as well with no luck.
Yes, the EF module won't help unfortunately.
Could you show me your machine.config file contents please? This SO question might help with that.
Allan
in one of my machine.config files I see this:
One of them? Are you sure that it is that one which is being loaded? Or is it possible another is being loaded which does not include the Oracle client reference?
Allan
when I make changes to this one I get errors when the datatables tries to load, so it definitely is using this one. However, I did read somewhere that all of them may be loaded.
But does the machine.config I posted above look correct?
It does look fine like that.
Could you show me the connection string you are using for the database please? (obfuscate the username and password of course
).
I'm not sure this is the answer, but this thread says you might need to add some configuration to the
web.config
file - but I'm not convinced by that one since we've not had to do that. The connection string is the next port of call I think.Allan
There is another thread here which might be of interest.
So if it of any consolation - you aren't the only one having problems with the Oracle drivers on .NET.
How are you normally making a connection to your Oracle db?
Regards,
Allan