I have a webservice in which I have a connectionstring in the web.config. I read the connectionstring with the following code:
var section = ConfigurationManager.ConnectionStrings;
var test = section.ConnectionString;
This gives me the correct and whole connectionstring:
"metadata=res://*/EvalDBEntityDataModel.csdl|res://*/EvalDBEntityDataModel.ssdl|res://*/EvalDBEntityDataModel.msl;provider=System.Data.SqlClient;provider connection string=\"Data Source=MyMSSQLServerName;Initial Catalog=EvalDB;Integrated Security=True;MultipleActiveResultSets=True\""
I want a config surface to my client app where the admin user could modify DB server name in case... I don't want to put the whole connectionsrting to the config surface. I just want the DB server (Data Source) could be modifiable. How can I complete my
code snippet to read the Data Source from the connectionstring? Shoul I modify the whole code snippet or can I extend this one?
View Complete Post