





















我就在页面中拖了一个WebPartManager 什么也没干,一运行,出现错误
Description: An unhandled exception occurred during the execution of the current web request. Please
review the stack trace for more information about the error and where it originated in the code.
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:
解决的办法是:
在web.config文件中重新设置一下:
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data Source=xxx;Initial Catalog=zzz;Integrated Security=true;"
providerName="System.Data.SqlClient" />
</connectionStrings>
同时在下面目录:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\下。
运行aspnet_regsql.exe此配制程序,可以方便的把aspnetdb里的存储过程和表移植到sql Server 2000等处.
.zzz为移植到的数据库表,例如Northwind
****因为vs2005依赖的就是express版的sql 2005里的aspnetdb ,而默认情况下LocalSqlServer的连接字符串是
<connectionStrings>
<add name=LocalSqlServer connectionString="data source=\SQLEXPRESS.;Integrated Security=SSPI;
AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />
</connectionStrings>
所以要先移除默认的连接字符串,添加一个新的连接字符串,如上面所示
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。