在我當前的項目,我有一些連接字符串,對地方發展的機器是有效的:如何在我的連接字符串上使用Web.Config轉換?
<configuration>
<connectionStrings>
<add name="ApplicationServices"
connectionString="Data Source=localhost;Initial Catalog=MyDB;Integrated Security=SSPI"
</connectionStrings>
....
</configuration>
我將如何使用的Web.Config轉變,從這個表達式轉換爲一個有效的爲我們的生產服務器?生產服務器一個看起來是這樣的:
<configuration>
<connectionStrings>
<add name="ApplicationServices"
connectionString="Data Source=IPAddress,Port;Initial Catalog=SomeOtherDB;User ID=TopSecretUsername;Password=SecurePassword"
</connectionStrings>
....
</configuration>
的語法並不明顯給我,我完全在所著的Grokking就可以了page失敗。
appSettings部分是可選的,具體取決於您如何設置連接。 – sbeskur
'appSettings'部件究竟做了什麼?另外,假設我可以使用'aspnet_regiis -pef'加密轉換後的'connectionStrings'是否安全? –
我使用appSettings的情況下,我有多個連接字符串本地Db VS一個託管在不同的機器上。這是純粹的便捷驅動,所以我可以使用appsetting來決定使用哪個數據庫。 (我真的應該只是把它從這個例子中刪除) – sbeskur