Using NHibernate to interact with MySQL

Source: Internet
Author: User

NHibernate official website for Http://nhibernate.info. Official website of documentation, help document the NHibernate Reference (HTML, single page HTML, PDF, CHM), Case tutorial Tutorial:your first NHibernate base D application, these two documents are my main basis for writing this article.

NHibernate is an object/relational database mapping tool for the. NET environment, and the following is an example of MySQL interaction.

C # connects to the MySQL database by writing code that calls the MySQL API to manipulate the MySQL database.

The principle of using nhibernate to interact with MySQL is that writing code calls NHibernate's api,nhibernate calls the MySQL API to manipulate the MySQL database.

1. Add a dynamic link library

(1) Add nhibernate dynamic link library

Method One: In the project (right-click)-Manage NuGet packages (N) and then search for nhibernate in the browser and install

Method Two: In NHibernate official website: http://nhibernate.info Click Download Now NH5.0.3 download and add \required_bins\nhibernate.dll to the reference

(2) Add a MySQL dynamic link library

Method One: In the project (right-click)-Manage the NuGet package (N) and then search for mysql.data inside the browser and install it.

Method Two: Install the database MySQL to select Connector.net 6.9 installation, will C:\Program Files (x86) \mysql\connector.net 6.9\ A reference to a project that is added to the MySql.Data.dll in assemblies v4.0 or v4.5. V4.0 and v4.5, corresponding to the version number of the. NET framework in the Visual Studio specific project properties-application-target framework.

Using NHibernate to interact with MySQL

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.