ASP. NET Mvc4 (vs.net 2013) connection MySQL

Source: Internet
Author: User
Tags mysql for visual studio

* may be because of different requirements, less practical mssql,mysql for the common database.

* How to use MVC to connect MySQL database, search the Internet a lot of information. Basically are talking about, also on the author himself understand, others difficult to understand ( perhaps I understand the ability is too poor )

Record these steps one is to save time for everyone, and second, to see if there is a simpler and more convenient way to connect.

Environment: Vs.net Mvc4 ef4.x

Os:win7 64bit

Db:mysql 5.5

1. Preparation:

In order to use MySQL normally, first you must first drive the Connectornet

http://dev.mysql.com/downloads/connector/net/

After the installation is complete, the Vs.net 2013 is still not working properly (2010 Pro test is feasible)

Then you have to install another plugin. Mysql for Visual Studio 1.1.1

Copy to Google and search for downloads directly.

2. Create a new MVC4 application that will be installed in step 1 under the Connectornet file

MySql.Data.dll

MySql.Data.Entity.dll

Copy to the bin folder in your project

At this point, the preparation is ready, then I have a few, easy to understand

3. Select MySQL Data:

Right-click the models folder, add = "New Item

What tables are needed Ah, view what's on their own ditch, after the end:

Right-click in the Controller folder, new = "Director

Probably just about the same thing. Browse to succeed:

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.