与SQL数据库连接MVC3会员 [英] connect mvc3 membership with sql database
问题描述
我使用的是内置成员与在线sql数据库MVC3,所以我改变了我的连接字符串如下:
I am using the built-in membership for mvc3 with an online sql database, so I changed my connection string to look like this:
<connectionStrings>
<add name="ApplicationServices"
connectionString="Data Source=72.18.142.170,1533;Network Library=DBMSSOCN;Initial Catalog=entertainment;User Id=uname;Password=pswd;"
providerName="System.Data.SqlClient"/>
</connectionStrings>
但是,当我尝试注册一个新用户,我得到了以下错误:
But when I try to register a new user I get the following error:
{无效的对象名称
dbo.aspnet_SchemaVersions'。} System.Data.SqlClient.SqlException
{"Invalid object name 'dbo.aspnet_SchemaVersions'."} System.Data.SqlClient.SqlException
感谢您的帮助。
推荐答案
表 aspnet_SchemaVersions
不存在于数据库中娱乐
(或者至少是默认模式)。 (相反,我想这可能是用户的uname
只是没有访问表。)
The table aspnet_SchemaVersions
doesn't exist in the database entertainment
(or at least in the default schema). (Conversely, I suppose it's possible that the user uname
just doesn't have access to the table.)
您需要创建表的成员资格提供使用。
You need to create the tables for the membership provider to use.
这篇关于与SQL数据库连接MVC3会员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!