需要與name = "SqlServer"
更改XML屬性C#
配置文件就像XML,而不是從我的項目
<connectionStrings>
<add name="SqlServer"
connectionString="Data Source=192.168.1.1; Initial Catalog=s; Application Name=s; MultipleActiveResultSets = true; Pooling=True; User ID=1111;Password=1111;" />
<add name="SqlServer_WinAuthentication"
connectionString="Data Source=.; Initial Catalog=MeterShop; Integrated Security=True; Application Name=MeterShop; MultipleActiveResultSets = true; Pooling=True;" />
<add name="SqlServer_SqlAuthentication"
connectionString="Data Source=.; Initial Catalog=MeterShop; User ID=1; Password=1; Application Name=1; MultipleActiveResultSets = true; Pooling=True;" />
</connectionStrings>
你有沒有嘗試什麼嗎?或者請顯示你所做的... –
所有我所做的 - 只需加載xml,並獲得連接字符串的所有節點 –
因此,您想添加一個新的節點或ConnectionStrings節點下的任何現有節點的更新名稱 –