Entity Framework Power Tools - cannot connect to Oracle - entity-framework

I have just installed Entity Framework Power Tools Beta 4 into Visual Studio 2013. I am running a .NET framework 4.5 project, using Entity Framework code first with an Oracle database. I have installed the latest ODP.NET from Oracle (version 12), including the EF drivers, and I have Oracle.ManagedDataAccess and Oracle.ManagedDataAccess.EntityFramework referenced in my project.
This set up allows me to run my project and read and access data from the Oracle database. It all works fine. My problem is when I try to use the Entity Framework Power Tools. I can specify a connection using the Oracle database name and credentials, and the dialog says 'Test Connection succeeded'. However, after clicking the next button, I get the following error:
System.Data.ProviderIncompatibleException: The store provider factory type 'System.Data.OracleClient.OracleClientFactory' does not implement the IServiceProvider interface. Use a store provider that implements this interface.
I am confused because my project is able to use the installed ODP.NET as is to communicate with the Oracle database via Entity Framework. Most of the research I have done on the WWW suggests there should be a problem with versions and the contents of the web.config - but if this is the case surely I wouldn't be able to use EF with Oracle in my project without errors?
Is it just the case that the Power Tools do not work with Oracle?
Cheers!
Martin

As Christian says in his comment, you need to install ODP.NET as a provider that Power Tools can use. I did this by installing Oracle Developer Tools for Visual Studio.

Related

What's the quickest way to generate Entity Framework model code given an SQLite database?

I've got an SQLite database defined by an SQL DDL (CREATE TABLE etc.) script and am to derive Entity Framework model classes to work with it.
In the past, when I had an opportunity to try Visual Studio 2013 Ultimate and Microsoft SQL Server in the same situation, Visual Studio allowed me to use "database-first" approach and reverse-engineer the model to create the model classes automatically. But I can't find anything like that available in Visual Studio 2015 Community and SQLite.
Am I missing something or are there, perhaps, 3-rd party tools that can do the job to set me free of mechanically typing all the model code manually?
If you use VS Express you are out of luck, since you cannot install DDEX providers or any other extensions using that edition. Use Community, the download sqlite-netFx46-setup-bundle-x86-2015-1.0.104.0.exe from http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki (see my blogpost here for detailed info: http://erikej.blogspot.dk/2014/11/using-sqlite-with-entity-framework-6.html )
If you use EF Core, upgrade to Community, and install the latest daily of my VS extension SQLite Toolbox, which has a feature to generate an EF Core Model via GUI https://github.com/ErikEJ/SqlCeToolbox/wiki/Release-notes

Oracle 11g and 12c together

I'm trying to use oracle 11g and 12c tools on the same machine.
Scenario:
1 - I'm developing a winforms app using Oracle.DataAccess from 11g
2 - I'm developing a web API with Entity Framework using Oracle.ManagedDataAccess from 12c
3 - I'm support a third party app that depends on oracle client 11g
Situation:
I manage to run and deploy the winforms app without oracle client installation, after that I started to develop the web API, so I installed ODT with ODAC121024 (including oracle client from 12c), and both work fine.
Then I had to support the third party app that needs oracle client from 11g, but I couldn't run the app because I did not had oracle client 11g, so I deinstall every thing on mine machine and installed the full oracle 11g.
Now the winforms app and the third party add works fine, but I couldn't make the web API to work.
I installed the nuget packages oracle.manageddataaccess and oracle.manageddataaccess.entityframework. But I'm getting the follow error on one of the projects of my solution (with 5 projects):
Error 175: The ADO.NET provider with invariant name 'Oracle.ManagedDataAccess.Client' is either not registered in the machine or application config file, or could not be loaded. See the inner exception for details.
This error occur on the .edmx file of my data model project.
I can't create another .edmx file as well because the oracle data provider does not show up on Visual Studio (2013).
For this to work I have to install ODT with ODAC121024, but I this will mess up the third party app access.
The question is: how to use ODAC 12c without installing the client?
Thanks.

Integrating Entity Framework 6.0 with Postgres 9.3

I have a local database developed in Postgres 9.3. The Postgres server name on my computer is just "localhost". I would like to use the Entity Framework 6 Designer that is built into Visual Studio 13 to automatically generate a data model of EF classes and properties that correspond to the database tables and columns.
As described in various web articles, and using Nuget package manager, I added onto VS 13 these extensions or packages: EF 6, Npgsql, Npgsql Data Provider for EF 6, and Dotconnect express for Postgresql. Afterwards, in the VS 13 Server Explorer window, I was able to connect and see my Postgres tables and columns.
However, I cannot seem to get the EF Designer Wizard to automatically generate the .edmx file. I tried adding an ADO.net data object, selecting "EF Designer from Database" and alternatively, "Code First from Database." When I got to the next screen, I had to choose a Data Source. I tried both "MS SQL Server Database File" and alternatively, "Other." For the Data Provider, there was no other option than ".Net Data Provider for SQL."
In the next screen I tried to create a connection, using SQL server authentication, with user name and password, but I could never get VS 13 to connect or even display the Postgres server like it did in Server Explorer window. For the Server Name I used the same one as I used for the Server Explorer window, ie. localhost.mydatabasename.myschema. For the SQL User, I used the owner of the Postgres database, a Role I created, ie. mydatabasename_role.
When that faied, I tried going into MS SQL Management Studio 2014 to see if I could display the Postgres server there, using the same info used in the Server Explorer window, but I could not get SSMS to display the Postgres server there either. Is there a way to automatically generate the data model and .edmx file as I have been trying, using just VS 13 and SSMS 14? Or do I need to purchase the proprietary / licensed version of dotconnect for Postgres developed by Devart? Thank you in advance.
A Visual Studio plugin is currently being developed which supports the EF Designer Wizard.
You can find it here: https://github.com/npgsql/Npgsql/pull/213
After about a week of research and banging my head againts my desk, I FINALLY got my Npgsql MVC Entity Framework application to work... and work WITH the wizard. The steps are below....
1) Close Visual Studio, then download and install Npgsql PostgreSQL Integration from: https://marketplace.visualstudio.com/items?itemName=RojanskyS.NpgsqlPostgreSQLIntegration
2) Reboot your computer. (yes, it's needed, I promise)
3) Open visual studio and install the following NuGet packages, IN THE ORDER listed and the VERSION listed...
--> EntityFramework version 6.0.0, then clean and rebuild
--> Npgsql 3.1.0, then clean and rebuild
--> EntityFramework6.Npgsql 3.1.1, then clean and rebuild
NOTE: You may need to uninstall other Nuget packages if these will not install in the order and version listed. If so, just make note and add them back later. and yes, you will want to clean/rebuild between each one above.
4) Close all applications and restart your computer. (yes, it's needed, I promise)
5) After your computer restarts, open Visual Studio again and go to your solution. NOTE: I advise you add a new project for your database connection, but this is more a preference than anything.
6) Try using the Entity Framework Wizard again. You should see the Npgsql selections and it shouldn't just crash on you.

Firebird + Entity Framework 6 in Visual Studio 2012 / 2013. How do I get both visual & non-visual components to work?

Does anyone have Firebird working with Entity Framework 6 at both design time and run time?
I'm mainly using VS 2012, but I get the same results in VS 2013.
Depending on the components I install I can get either design time or run time to work, but not both together.
If I install the latest .net provider & DDEX provider from http://www.firebirdsql.org/en/additional-downloads/ then DDEX works at design time.
I can use server explorer to connect to a database & can create a model using Entity Framework.
But run time fails with the following error:
The Entity Framework provider type 'FirebirdSql.Data.FirebirdClient.FbProviderServices, FirebirdSql.Data.FirebirdClient' registered in the application config file for the ADO.NET provider with invariant name 'FirebirdSql.Data.FirebirdClient' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
If instead I install the the nuget package PM> Install-Package FirebirdSql.Data.FirebirdClient run time works, but I can no longer use server explorer or reverse engineer a database.
Just need to run the reg files depending of the architecture of the system (86 or 64). This files are in the source package (http://sourceforge.net/projects/firebird/files/firebird-net-provider/DDEX%203.0.1/DDEXProvider-3.0.1.0-src.7z/download).
Note: Edit the %path% variable in the reg file to point to the correct folder in your system.

Sybase ASE ADO.net 2.0 provider?

I'm looking for an ADO.net 2.0 or later provider for Sybase database which seems to be known as Sybase ASE. To clarify, I'm interested in ASE, and not SQL Anywhere. Hopefully the provider will be included with the database, or free.
I can find mention of an ADO.net 1.1 provider; that's not what I want.
I can find mention of ODBC drivers and OLEDB providers; that's not what I want.
I've found the DataDirect ADO.net providers which are paid for; I guess that's the fallback position.
Thanks for your help
Having recently been down this road myself, I can only suggest that you wont find the answer through searching the net. If you are connecting to an ASE server, then you have a customer technical contact. Use that person, asking them to download the earlier mentioned Sybase 15 #ESD10.
From my experience (which I freely admit, was a bad one);
Sybase makes this sort of developer resource available to paying customers only.
The download, once you have it, will include a whole bunch of extras that you wont need. I still think that PowerDesigner is a great utility, but I think that what is included is a trial version, of limited long term value. I believe that what you want from the set is the OpenClient install, selecting the ADO.NET features.
I found the whole experience, from acquiring the developer resources (just identifying the right download was a struggle), to isolating out the two files necessary from the hundreds of installed files, to the fact that the install broke my existing RapidSql and DbArtisan installs, and finally that the current version goes no further than ADO.NET 2 provider support (you wont get EF wiring for example), to be truly frustrating.
No surprise then that I have not been able to find much support for ASE using nHibernate or subsonic either.
This question is fairly old but it seems to have gotten easier to get the ADO Connector.
Download the "Get a Free "Developer" Edition" from
http://scn.sap.com/community/developer-center/oltp-db
Choose Custom Install when given the option.
Only install the .Net ADO package from the custom install.
Reference the Sybase.AdoNet4.AseClient.dll in your solution from where the install put the files.
You should then be able perform queries, updates etc. in .NET by following the directions from here:
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.sdk_12.5.1.adonet/html/adonet/DAFJEFIF.htm
As an alternative to the SAP/Sybase driver, we developed our own ADO.NET Core driver for ASE:
https://github.com/DataAction/AdoNetCore.AseClient
.NET Core was a key technology for us - in particular for AWS Lambda - and there is still no ADO.NET Core driver available from SAP/Sybase.
Our driver supports most of the SAP/Sybase ADO.NET features, aims to be a drop in replacement to the SAP/Sybase one for easy transition, and supports all of the .NET Frameworks you would care about.
You can get it on Nuget:
https://www.nuget.org/packages/AdoNetCore.AseClient
Sybase 15 #ESD10 has support for ADO.NET 2.0, according to this link at Sybase:
http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc20155.1500/html/newfesd/CBHJAABF.htm
New Features Open Server 15.0 and SDK 15.0 for Microsoft Windows, Linux, UNIX, and Mac OS X
ADO.NET 2.0 support
ASE ADO.NET Data Provider 2.0 is shipped with this SDK release. The ADO.NET 2.0 features supported in this version are:
* Provider factories
* Provider statistics
* Bulk update
* Bulk copy
* Asynchronous commands
* Extended pooling support to clear pools
* Common base classes
* Database metadata
For more information on the supported ADO.NET 2.0 features, see What’s New in ADO.NET 2.0.
From the sybase website:
Sybase support for ADO.NET, OLE DB, and ODBC
Adaptive Server version 15.0 contains new ODBC and OLE DB drivers developed by Sybase. The third-party rebranded ODBC and OLE DB Driver Kits included with previous versions are no longer shipped.
The retired ODBC Driver Kit was installed in %SYBASE%\ODBC, and registered with the ODBC Driver Manager as “Sybase ASE ODBC Driver”. The new ASE ODBC Driver by Sybase is installed in %SYBASE%\DataAccess\ODBC, and registered as “Adaptive Server Enterprise”. The version shipping with Adaptive Server and SDK 15.0 is version 15.0.0.50.
The retired OLE DB Driver Kit was installed in %SYBASE%\OLEDB, and used the provider short name of “Sybase.ASEOLEDBProvider” and the long name of “Sybase ASE OLE DB Provider”. The new ASE OLE DB Provider by Sybase is installed in %SYBASE%\DataAccess\OLEDB, and uses provider short name “ASEOLEDB”. The version shipping with SDK 15.0 is version 15.0.0.51.
Sybase recommends that you start your migration process the new ODBC and OLE DB drivers as soon as possible. New features introduced in Adaptive Server 15.0 are supported only by the new drivers.
See “New Features for OpenServer 15.0 and SDK 15.0 for Windows, Linux and UNIX”, for instructions on migrating to the new drivers.