Getting started using Entity Framework with DB2 - entity-framework

This is my first time building a .NET application that connects to a DB2 database, and I really have no idea where to begin as I've never worked with DB2 before.
Here's what I've done so far:
Installed IBM.Data.DB2.EntityFramework
Installed IBM.Data.DB2.iSeries
Installed Entity Framework 6
Now when I try to create a code first model, I don't see DB2 in the list of available data sources, so I'm guessing I need to figure that out first.
What do I need to do to get DB2 added as a data source? I know it's possible because I can see it in the first screenshot in this previously answered question.

you have to install IBM Data Server Client Packages and IBM Database Add-Ins for Visual Studio

Related

Migrating from ef6 to postgresql in visual studio

I am new to PostgreSQL and as a company, we have found out that PostgreSQL is better than SQL Server on processing online transactions and we have reached a conclusion to migrate from SQL Server to PostgreSQL.
I have bought DBConvert to successfully migrate the database from MS SQL Server to PostgreSQL and that is just fine, all data has been transferred. Now, the problem comes when I now have to move my visual studio from EF to PostgreSQL. I have researched how best I could really do this. This Article is not detailed enough:
Migrate EF6 database-first from SQL Server to PostgreSQL
An several aren't detailed enough. Can anyone assist me in a step-by-step approach on how best I could do this?
Well, I finally found that the only way to successfully move from Visual Studio Entity Framework to PostgreSQL, you have to use the Code First Approach.
There is no scaffolding solution I found to do the conversion. You will have to install the Npgsql Provider, change the connection string to point to PostgreSQL, and also install the Npgsql.EntityFramwework and make sure your models have been changed accordingly.

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.

DB2 connectivity without client drivers

I'm using EF 6 (Code first) with the IBM.Data.DB2.EntityFramwork nuget package to access a db2 database server. Working locally it all works as expected, but when deployed to a test server I get an exception: "System.MissingMethodException: Method not found: 'Void IBM.Data.DB2.InternalStruct6.SetDefault()"
I'm no DB2 wizard but I think the issue is related to a incompatible version of the db2 client drivers installed on the test server (9.7?). Entity framework 6 support needs version > 10.5. (I must have installed the 10.5 version locally at some point).
It would be nice to be able to run the application on any pc without additional dependencies, so my question is: Are there any way of skipping the db2 clients/drivers installation, and rather reference certain db2 dll's (or other nuget packages), to access db2 db servers?
Ok, I think asking the question resulted in a moment of enlightenment.
I guess the answer is NO, as the db2 clients/drivers actually installs the db2 odbc data source driver for db2. (Located in Administrative Tools -> Data Sources (ODBC)).

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.

SQL Anywhere 11 (Sybase) with Entity Framework in Visual Studio SP1?

Well, the question is pretty much in the title. I've just installed Visual Studio SP1, and now when I want to import a Entity Model from a database, it doesn't display the SQL Anywhere provider anymore.
Does anyone know if there is a patch or some way to make it work with SP1?
Thanks.
There is a post on the ASP.NET Team blog that it will be available in Q3-Q4 of 2008. So I guess SP1 does need a new version of SQL Anywhere component.
Did you try to reinstall the integration component just in case?
try to install lastest build of SA. And you need to install it after SP1.
I had the same issue and did the following:
Control Panel -> Uninstall a program
Selected SQL Anywhere 12 - Client an clicked Repair. This made me unable to connect to any database from Sybase Central with an error message about JDBC.
Selected SQL Anywhere 12 and clicked Repair.
After that the provider showed up in Visual Studio and I was able to create a new connection to create an Entity Framework model.