使用MySQL设置.NET MVC3 [英] Setting up .NET MVC3 with MySQL

查看:152
本文介绍了使用MySQL设置.NET MVC3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hy Guys,

如何配置webconfig以使用MVC 3访问mysql数据库?

How can I configure the webconfig to access a mysql db using MVC 3?

要使用SQLExpress我包括这个代码在一个例子中配置...

To use SQLExpress I included this code to configure in an example...

<add name="MovieDBContext"
     connectionString="Server=.\SQLEXPRESS;
     Database=Movies;Trusted_Connection=true"
     providerName="System.Data.SqlClient" />

我正在使用实体框架。

PS:我不想用MVC自动创建表。我想手动创建它们。

PS.: I don't want to automatically create tables with the MVC. I want to create them manually.

Thks!

推荐答案

看看这篇文章,似乎你最好的选择是使用MySql连接器与EF

Take a look at this post, it seems like your best option is to use MySql Connector with EF

使用MySQL与实体框架

您的连接字符串应该如下所示:

your connection string should look something like:

Server = myServerAddress; Database = myDataBase; Uid = myUsername; Pwd = myPassword;

这篇关于使用MySQL设置.NET MVC3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆