Q:如果資料庫是放在App_Data下要如何發行至Server啊?? 資料庫連線要如何修改!!
A:嗯, publish完就沒事了…
如果有特殊權線或Profile問題,參考 這篇
開發工具:Visual Studio 2010
OS:Windows 7 + IIS 7.5
Web Service和ASP.NET運作方式應該相同,以ASP.NET專案測試,測試步驟:
- 選Entity (嗯,因為電腦混裝 Visual Studio 2012,精靈的畫面被改掉了)
產生的connection String:
<connectionStrings>
<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
providerName="System.Data.SqlClient" />
<add name="DatabaseEntities" connectionString="metadata=res://*/App_Code.Model.csdl|res://*/App_Code.Model.ssdl|res://*/App_Code.Model.msl;provider=System.Data.SqlClient;provider connection string="data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\Database.mdf;integrated security=True;user instance=True;multipleactiveresultsets=True;App=EntityFramework""
providerName="System.Data.EntityClient" />
<add name="DatabaseConnectionString1" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
- 在ASP.NET Web Development Server 試run,OK