How to configure connection string for MySQL database in C # project without using dialog boxes?

NOTE. Apparently, the reason the installation of the MySQL connector does not appear automatically in the dialog boxes for adding a data source is because the Visual 2008 Express Edition does not allow "third-party integration" in the Visual Studio IDE. This way it does the setup The manual data source is even more important because there are no integrated tools from the MySQL connector.


My goal is to establish a connection to a MySQL database using the Entity Framework (ADO.NET Entity Data Model). All the wizards and dialog boxes upset me, and I still can't find what I'm looking for.

Here's what I have done so far: I just installed MySQL.NET Connector v6.1.3 on my computer (as far as I know, it is installed correctly. It is displayed in the "Add or Remove Programs in the Control Panel" section). In Visual Studio (Visual C # 2008 Express Edition Service Pack 1 (SP1) with the version of Entity Framework that ships with Service Pack 1), I click to add a link to the project, click "ADO.NET Entity Data Model", and this will bring me to the screen What should the model contain? β€œI select Create from Database, and then click Next.

This screen asks which data connection I should use. I click "New Connection" and get a screen that looks like this:

EntityFrameworkDataSource.jpg

Where is the option for ADO.NET MySQL Connector that I just installed?

I know where to find the connection string for MySQL, but I can’t figure out how to get it in my application so that Visual studio recognizes it, uses the ADO.NET connector and allows me to select this connection to create the Entity model. How can I do that?

+4
source share
2 answers

Use the app.config file (or web.config) to add the entry. Make sure provider = provider specified MySQL provider correctly.

+1
source

There is no support for third-party extensions in Visual C # 2008 Express Edition SP1.

This is mentioned in this blog post from Dan Fernandez.

Additional information on the difference between Express and Professional editions is available here in Visual Studio 2008 Product Comparison.

+1
source

Source: https://habr.com/ru/post/1260801/


All Articles