How to connect to MySQL database inside .NET platform?

I am opening a discussion here on the topic, I could not find an answer enough to be called the final answer: MySQL and .NET.

Although I know that there are many ways to make this connection, I am trying to find a list of the pros and cons of each approach.

I have been using ADO.NET with MySQL NETconnector from the very beginning of my project, and everything was fine when the database was new and did not have many records. But now I am faced with a situation where the number of records is growing exponentially, and I have found another way to query the database, which is an ODBC connector. Using the ADO.NET + NETConnector solution, I had O / RM and I didnโ€™t have to write my queries, while ODBC makes my code look awful now (since I havenโ€™t completely switched to ODBC, I have Linq queries and plain SQL requests inside my code).

Is there any solution (free or not) where I can have as O / RM without having to write SQL queries and ODBC speed?

+4
source share
2 answers

What you should do is use the MySQL ADO.NET Connector and store your queries in a database in the form of stored procedures . Version 6.0 of the MySQL Connector also supports the Entity Framework . If you are interested in using the Entity Framework, check out this link that describes how to install it.

+2
source

NHibernate

Update comments

NHibernate Proxy Generators This is a bytecode generator for your object model that allows NHibernate to perform lazy loading and other operations. This link explains the benefits.

Castle and LinFu are two different implementations of these proxy generators.

While NHibernate does not have matching documentation, all information on how to use it is on the Internet. However, this can be an obstacle to usability for some people. I understand NHibernate more because of my past experience with Hibernate.

0
source

All Articles