属性connectionstringName缺失或为空 [英] The attribute connectionstringName is missing or empty
本文介绍了属性connectionstringName缺失或为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨朋友们,
我在尝试使用Membership或Profile.Here获取或创建用户时遇到此异常。这是我的web.config代码。我正在使用VS2010 Framework 4.0。
可能是什么问题?
Hi Friends,
I am getting this exception when trying to get or create a user using Membership or Profile.Here is my web.config code.I am using VS2010 Framework 4.0.
What could be the problem?
<connectionStrings>
<add name="classConnectionString" connectionString="Data Source=MINHAS\SQLEXPRESS;Initial Catalog=Test;Integrated Security=True"/>
</connectionStrings>
<profile defaultProvider="MyProvider">
<properties>
<add name="Name" type="System.String"/>
<add name="ID" type="System.String"/>
<add name="Color" type="System.String"/>
</properties>
<providers>
<clear/>
<add name="MyProvider" type="System.Web.Profile.SqlProfileProvider" connnectionStringName="classConnectionString" applicationName="/"/>
</providers>
</profile>
<membership defaultProvider="MyProvider">
<providers>
<add name="MyProvider" connnectionStringName="classConnectionString" type="System.Web.Security.SqlMembershipProvider" applicationName="/" enablePasswordRetrieval="true" enablePasswordReset="true" passwordFormat="Encrypted" requiresQuestionAndAnswer="true"/>
</providers>
</membership>
推荐答案
您在连接字符串名称中给出了n次n
You have given three times n in connection string name
incorrect
connnectionStringName="classConnectionString"
正确
correct
connectionStringName="classConnectionString"
请参阅 -
http://stackoverflow.com/questions/12116955/the-attribute-connectionstrin gname-is-missing-or-empty-in-web-config [ ^ ]
Refer this-
http://stackoverflow.com/questions/12116955/the-attribute-connectionstringname-is-missing-or-empty-in-web-config[^]
这篇关于属性connectionstringName缺失或为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文