* 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: