我的连接字符串有问题
|
当我尝试登录时抛出异常:
无法打开登录请求的数据库\“ aspnetdb \”。登录失败。
用户\'DIMA-00AA1DA557 \\ Dima \'的登录失败。
System.Data.SqlClient.SqlException:无法打开登录请求的数据库\“ aspnetdb \”。登录失败
我的Web.config:
<system.web>
<roleManager enabled=\"true\" />
<membership defaultProvider=\"MyMembershipProvider\">
<providers>
<clear/>
<add
name=\"MyMembershipProvider\"
type=\"System.Web.Security.SqlMembershipProvider\"
connectionStringName=\"LocalSqlServer\"
requiresQuestionAndAnswer=\"false\"
minRequiredPasswordLength=\"1\"
minRequiredNonalphanumericCharacters=\"0\"
enablePasswordReset=\"true\"
maxInvalidPasswordAttempts=\"1000\"
passwordAttemptWindow=\"4000\"
enablePasswordRetrieval=\"true\"
requiresUniqueEmail=\"false\"
passwordFormat=\"Encrypted\"
/>
</providers>
</membership>
</system.web>
我的连接字符串部分
<connectionStrings>
<clear />
<add name=\"LocalSqlServer\"
connectionString=\"Data Source=localhost;Integrated Security=SSPI; Initial Catalog=aspnetdb\" />
providerName=\"System.Data.SqlClient\"
<add name=\"YourGuruDB\"
connectionString=\"Data Source=DIMA-00AA1DA557;Initial Catalog=model;Integrated Security=True\"/>
<add name=\"modelConnectionString\"
connectionString=\"Data Source=DIMA-00AA1DA557;Initial Catalog=model;Integrated Security=True\"
providerName=\"System.Data.SqlClient\"/>
<add name=\"LocalSqlServer2\"
connectionString=\"Data Source=.\\SQLEXPRESS;AttachDbFilename=\'D:\\Documents and Settings\\Dima\\My Documents\\Visual Studio 2010\\WebSites\\WebSite10\\App_Data\\ASPNETDB.MDF\';Integrated Security=True;User Instance=True\"
providerName=\"System.Data.SqlClient\"/>
<add name=\"MyLocalSQLServer\"
connectionString=\"Initial Catalog=aspnetdb;data source=localhost;Integrated Security=SSPI;\" />
</connectionStrings>
没有找到相关结果
已邀请:
1 个回复
壤欠攻混