我在 VS2010 中构建的网站上有一个注册页面,当我在点击注册中填写表格时,我收到以下错误。帮助将不胜感激。
System.Exception was unhandled by user code
Message=Insert Error:Directory lookup for the file "C:\Users\myname\Documents\myname\Project\App_Data\SJDatabase.mdf" failed with the operating system error 5(error not found).
Cannot attach the file 'C:\Users\myname\Documents\myname\Project\App_Data\SJDatabase.mdf' as database 'SJDatabase'.
连接字符串:
<connectionStrings>
<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
<add name="MyConsString" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|SJDatabase.mdf;
Initial Catalog=SJDatabase;
Integrated Security=SSPI;"
providerName="System.Data.SqlClient" />
</connectionStrings>