I have a config file and a pollingservice with different methods in the polling service. What i want to happen is that when it hits a certain method in the polling service i want to change the connection string in the config file from:
<add name="Entity" connectionString="metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;provider=System.Data.SqlClient;provider connection string="Data Source=dev;Initial Catalog=DB;Persist Security Info=True;User ID=a;Password=asdf;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
为此:
<add name="Entity" connectionString="metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;provider=System.Data.SqlClient;provider connection string="Data Source=dev_Test;Initial Catalog=DB_Test;Persist Security Info=True;User ID=a;Password=asdf;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
请协助。
感谢。