清空-青空-晴空

首页‎ > ‎技术‎ > ‎C# .NET‎ > ‎

asp.net membership connect to SqlExpress database

发布者:Bowen Gu,发布时间:2009-10-5 上午5:04
SQLExpress database file auto-creation error:

The connection string specifies a local Sql Server Express instance using a database location within the applications App_Data directory. The provider attempted to automatically create the application services database because the provider determined that the database does not exist. The following configuration requirements are necessary to successfully check for existence of the application services database and automatically create the application services database:


解决方法:

删除App_Data目录,

往web.config里添加:

  <connectionStrings>
    <remove name="LocalSqlServer"/>
       <add name="LocalSqlServer" connectionString="Data Source=AAA;Initial Catalog=BBB;Integrated Security=True"
            providerName="System.Data.SqlClient" />
  </connectionStrings>

MSN
   
MAIL