I'm new to ASP.NET and MVC, trying to move from WinForms. I'm using Visual Studio 2017 Pro, and I am trying to follow some tutorials for connecting to an existing MySQL database. I plan to use the Database First method as the database already exists. I have the following config :-
Windows 10 Pro 64 bit on my PC
VS 2017 Pro
MySQL for Visual Studio 2.0.5
MySQL Connector 6.10.4
EntityFramework v6.2.0
Mysql.Data 6.10.4
Mysql.Data.Entity 6.10.4
Mysql.Web 6.10.4
I can make a database connection using the Server Explorer, but when I'm using the EDM wizard to create the model from the database, the connection isn't showing in the drop-down box, and if I try to create a new one, the MySQL driver doesn't show as an available option, only SQL Server.
I've tried various combinations of MySQL for VS, MySQL Connector, EF and MySQl components (older versions) but I can't seem to find a winning combination.
Has anyone managed to achieve this ? I'm pulling out what's left of my hair. Thanks.
enter image description here
OK I finally found an answer, I now have EF 6.1.3 and MySQL Connector 6.9.9 installed.
I needed to change the part of the Web.Config file as described by James Wilkins in this post.
Thanks to Panagiotis for your help.
Related
Hi I am trying to use Entity-Framework in asp.net MVC , for that I have installed Oracle.Managed.DataAccess version 19.6.0 and Oracle.Managed.DataAccess.EntityFramework version 19.6.0
and oracle version 11.2.0 I am able to connect Oracle DB in server explorer but while adding new item in solution not getting any option to connect Oracle DB what is the issue I am not able to identify ,Any idea would be appreciated.
Image
Those are just the Nuget packages to allow your project to connect to Oracle.
I believe you need to add Oracle Developer Tools for Visual Studio to have the options available in the Visual Studio dialogs.
https://www.oracle.com/database/technologies/developer-tools/visual-studio/
You need to install a Oracle Client and TNSNAMES.ORA
The installation has a component list, if you insall that components (like Oracle developer Tools for visualStudio) it you can add your EF. and then when you finish you only need to add your TNSNAMES in order to create the Entities in VS.
I work on Windows Forms project in C# and I need to connect to mysql database (localhost:3306).
I use Entity framework 6.4.0 and .NET Connector 8.0.18.
When I go to Project -> Add New Item -> Data -> ADO .NET Entity Model and go to Code First from database -> New Connection , my Choose Data Source Dialog haven't option for MYSQL DATABASE
I have Mysql Workbench 8.0 and I connected to database.
When I click on other option I have dialog:
Can't find database to select.
Where is the problem?
For that case, it normally happens when you install visual studio after installation of MySQL. Try re-installing MYSQL then it will have to work.
Note: Ensure backing up all your databases first
Happy programming.
I am creating a project with ASP.NET and which would be connected on our University website and their currently using XAMPP MySQL on their system so I need to adjust on their database technology at the same time I want to implement Entity Framework of C# for faster development. Thanks you.
Ive already tried adding references on the project like MySQL.Data and installing MySQL Connector for Visual Studio but turns out it is for the MySQL not the XAMPP MySQL.
You can connect to your MySQL db in Visual Studio by going to the Server Explorer and click on the Connect to Database. Then select Microsoft ODBC Data Source and click continue. Make sure you enter your connection string.
This might be of help to you : https://www.youtube.com/watch?v=EhqknuizUKk
I want to connect to a database(Oracle 12c) for generating ADO.NET model, Code First From Database. I have installed ODAC for VS but there is still no option for connecting Oracle DB at the Entity Data Model Wizard:
At Server Explorer there is a Oracle provider but it is stated as deprecated:
I've also tried to install the following 4 Nuget packages but still no Oracle provider at Entity Data Model Wizard:
I'm suspecting VS2017(Community) is not looking at where I installed ODAC for the list of providers it use but I can't figure where it store this configuration.
Is there anything I'm missing? Or is there other ways to use EF for Oracle? E.g. Fallback to VS2015, create entity models manually (how do I do that?), etc.
Please help me I don't want to write plain SQL in code ever again! Thanks.
I have the same error. I solve this problem by add Oracle database from Visual 2015. And then Open project by Visual 2017. It done. I has been read a lot of topic about this. They say now, Oracle not yet Support for connecting Oracle DB at the Entity Data Model Wizard you can see at here:
https://community.oracle.com/thread/4024914
There is something extra:
Nuget package manager suggests Oracle.ManagedDataAccess.EntityFramework 18.3.0
This won't work with the latest ODP.
Nuget Package versions should match ODP versions:
ODP 12.2.0.1.1
Nuget Oracle.ManagedDataAccess.EntityFramework 12.2.1100
If not the Entity Data Model Wizard will crash without leaving any trace in the
C:\Users\YOURUSER\AppData\Roaming\Microsoft\VisualStudio
I solved this by installing Oracle Developer Tools for Visual Studio 2017
I hade the sam problem, but found the solution here:
Do not use the .NET driver. Use the ODP.NET driver (managed or unmanaged).
http://www.oracle.com/technetwork/topics/dotnet/whatsnew/vs2012welcome-1835382.html
Create a new connection from Server Explorer in Visual Studio and use these images as guides: change the datasource, making sure to choose the flavor of ODP.NET that your .NET application will use (Managed or Unmanaged) - and then connect to oracle. In the Oracle connection dialog, if you have a connection alias choose a "Connection Type" of "TNS" and then choose the alias from the "Data Source Name" drop down list. If you do not have a connection alias, you can choose a Connection Type of "EZ Connect" and then provide the host, port, and service name for the database you wish to connect to.
Best Regards, Par
I was facing same problem. first ensure that you installed odac for visual studio 2017
just go this link and follow:
https://www.oracle.com/technetwork/topics/dotnet/downloads/odacmsidownloadvs2017-3806459.html
uninstall previous odac version.
Hopefully, if you install from the link, you will get all things.
I'm new to C#, ado.net and visual studio 2012, just to make that clear from the beginning.
I'm trying to connect an ADO.NET Entity Data Model to a postgresql database.
I tell VS to 'generate mdoel from database' and click to make a new connection. Postgresql is not listed as an alternative data source (I can only see different microsoft mysql sources).
I did download the npsql .dlls and put them in the projects\ folder. I then added them by PROJECT->Add Reference->browse, check them and press ok.
Postgresql does still not appear as an alternative when I try to make a new connection.
In advance, thanks!