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

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.

Related

Entity Framework Power Tools - cannot connect to Oracle

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.

using EntityFramework 6 with SQL Server Compact 4

I am developping an application using Entity-Framework and Sql Server Compact 4 in a Visual Studio 2013 project.
Here is the list of add-ons I installed via NuGet :
Microsoft.SqlServer.Compact 4.0.8876.1
EntityFramework 6.1.3
EntityFramework.SqlServerCompact 6.1.3
Then I want to add an ADO.NET Entity Data Model ("Code First from database").
I choose a sdf file that I already have created with SQL Server Compact Toolbox. The Wizard find it and generate a connection string
Data Source=E:\[...]\myDBtest.sdf
Then I click "Next >", the Wizard becomes gray, freezes a few seconds and then closes itself without showing the following step.
At the end, it did not generate anything into my project.
I tried to rebuilt the project before adding the ADO item.
And I even tried to reboot the computer ... with no more success.
Any suggestion or same experience ?
Of course you can use Db First with EF and SQL Server Compact. In order to avoid the error, install the latest Visual Studio Tools for EF (6.1.3) https://www.microsoft.com/en-us/download/details.aspx?id=40762

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.

When SQL isn't explicitly installed what is the default data store Visual Studio 2012 and/or Entity Framework 5/6?

I have the situation below and can't figure out where everything is being saved.
I'm using a new installation of Visual Studio 2012 and didn't explicitly install any version of SQL. I created a Console project in VS and used NuGet to add references to the latest -Pre version of EF (6.0.1 at the time).
When I did the database operations I wanted (just some test stuff: create, add, query, migrations, etc.) everything worked. Shutdown the application, bring it back up and the data was persisted correctly. No problem so far.
When I went to look at the database I was surprised to find that I didn't have Management Studio installed. I also wasn't able to see any databases in the SQL Server Object Explorer in VS2012. I could see a "(localdb)\Projects" server but my database wasn't in it.
When I checked the generated connection string it was:
Data Source=.\SQLEXPRESS;Initial Catalog=TestProject.Context;Integrated Security=True;MultipleActiveResultSets=True
Using add server in the SQL Server Object Explorer I had to manually enter server names since none were found automatically. I tried localhost\SQLEXPRESS, (localdb)\SQLSERVER, .\SQLEXPRESS, and other similar variants, but those couldn't be found either.
Where is everything being saved?
Thanks.
If SqlExpress is not installed the default is (localdb)\v11.0 which is installed when you install VS2012 (or VS2013).

Enterprise Library 5.0 don't show namespace Microsoft.Practices.EnterpriseLibrary.Data

I was using Visual Studio 2008 with Enterprise Library 4.0. It is working fine and showing namespace Microsoft.Practices.EnterpriseLibrary.Data. Now I installed VS 2010 and Enterprise Library 5.0.(because 4.0 sowsn't support vs 2010 ).
But the problem is Enterprise Library 5.0 doesn't show Microsoft.Practices.EnterpriseLibrary.Data. Is there another namespace in 5.0 thriugh which I can access the Database class which comes under Microsoft.Practices.EnterpriseLibrary.Data namespace?
please let me know.
You are probably targeting .NET Framework Client Profile. The Data Access Block has dependencies on System.Data.Oracle and requires the full .NET Framework.
For anyone else hitting this problem with moving their DAAB-based app to .NET4, entlib5 is supplied with the source code installable via e.g. C:\Program Files (x86)\Microsoft Enterprise Library 5.0\src\Enterprise Library 5.0 - Source Code.msi
Running that msi and accepting the defaults creates a EntLib50Src folder under your Documents area. If you go into EntLib50Src\Blocks\Data and open Data.2010.sln you can change the target framework to .NET Framework 4 Client Profile.
This will create a bunch of errors related to the System.Data.Oracle dependency. Remove the reference to it, and then exclude the Oracle parts of the project and comment out any Oracle references in the common code.
If you then recompile with strong name signing on you can use the output assemblies (Microsoft.Practices.EnterpriseLibrary.Common.dll and Microsoft.Practices.EnterpriseLibrary.Data.dll) with .NET Framework 4 Client Profile. You do have to distribute Microsoft.Practices.Unity.dll from the e.g. C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin area but this is client profile-compatible.
Note that the above works if you're not needing Oracle support in your app. Mine doesn't, its SQL Server and VistaDB only. The above should work with any non-Oracle db compatible with ADO.NET.