“找不到用户名”修改provider元素后
我在访问 ASPNETDB.MDF 数据库时遇到问题。它实际上工作正常,直到我向网络配置添加一些代码。这是我添加的阻止我连接的代码...
<membership defaultProvider="CustomizedProvider">
<providers>
<add name="CustomizedProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="LocalSqlServer"
applicationName="MyApp"
minRequiredPasswordLength="5"
minRequiredNonalphanumericCharacters="0"
/>
</providers>
</membership>
我添加它是因为我想利用它提供的密码限制。也就是说,连接字符串的名称没有更改,代码也没有更改。但是当我尝试登录时,它告诉我找不到用户名。我应该注意到我正在使用相同的 un 和 pw,顺便说一句,它们满足这些新的约束。
这是一个 ASP.NET 4.0 应用程序
I am having trouble hitting the ASPNETDB.MDF database. It actually works fine until I add some code to the web config. This is the code I added that prevents me from connecting...
<membership defaultProvider="CustomizedProvider">
<providers>
<add name="CustomizedProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="LocalSqlServer"
applicationName="MyApp"
minRequiredPasswordLength="5"
minRequiredNonalphanumericCharacters="0"
/>
</providers>
</membership>
I added it because I wanted to take advantage of the password constraints it affords. That said, the name of the connection string hasn't changed and no code change. But when I try to log in its telling me that the username cannot be found. I should ntoe that I am using the same un and pw which, by the way, meet these new constraints.
This is an ASP.NET 4.0 application
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
语法似乎没有任何问题,如果连接字符串名称正确,那么您确定应用程序名称正确吗?这应该是数据库中的应用程序名称(默认为“/”),而不是 Visual Studio 中的应用程序名称。
There doesn't seem to be anything wrong with the syntax, if the connection string name is correct then are you sure the application name is correct? This should be the application name in the database (defaults to '/') not the name of your application in visual studio.