创建MVC4会员数据库 [英] Create MVC4 Membership Database

查看:93
本文介绍了创建MVC4会员数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我熟悉的 aspnet_regsql.exe的以创建一个会员数据库(它产生11表)

I'm familiar with aspnet_regsql.exe to create a membership database (it produces 11 tables)

不过,在我MVC4项目VS2010创建了一个会员数据库只有六张表(申请,会员资格,档案,角色,用户和放大器; UsersInRoles)

However, in my MVC4 project VS2010 created a Membership Database with just six tables (Applications, Memberships, Profiles, Roles, Users & UsersInRoles)

如何创建这个(新?)模式的数据库?

How can I create a database with this (new?) schema?

推荐答案

aspnet_regsql.exe的是ASP.Net架构的一部分,而不是MVC。

aspnet_regsql.exe is a part of ASP.Net architecture, not MVC.

我敢打赌,在MVC4开发preVIEW带有在其项目结构的一些自定义模式脚本,或者说,它具有新的ASP.Net 4.5版本preVIEW版本 aspnet_regsql .EXE 安装。

My bet is that the MVC4 Developer Preview comes with some custom schema scripts in its project structure, or that it has a preview version of the new ASP.Net 4.5 version aspnet_regsql.exe installed.

如果后期是真的,你也许可以用它来创建一个数据库,并将其绑到你的MVC3(和之前的版本)的应用程序。的含义这里,因为模式的不同,你可能会需要编写自己的供应商。

If the later is true, you could perhaps use that to create a database, and tie it into your MVC3 (and prior) applications. The implications here are because of the schema differences, you would likely need to write your own Providers.

另一个选择是与您的MVC4模板创建数据库,删除项目,code在MVC3项目,该项目使用数据库中的DA层。所有你需要抓住的是连接字符串。但同样,你将不得不推出自己的提供商旧的就不知道了新的6台的架构。

Another option would be to create the database with your MVC4 template, delete the project, and code a DA layer in your MVC3 project that uses the database. All you'd need to grab is the connection string. But again, you would have to roll your own providers as the old ones wouldn't know the new 6-table schema.

这篇关于创建MVC4会员数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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