A
Alan T
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
<add name="DataBaseConnection"
connectionString="server=localhost;database=SalesDB;User
ID=sales1;Password=sales1"/>
</connectionStrings>
</configuration>
This is the code I use to read the whole string value:
string sConn =
config.ConnectionStrings.ConnectionStrings["DataBaseConnection"].ToString();
I want to do the followings:
1) retrieve each value of the "server", "database", "User" and "Password"
2)write back to configuration file:
server=localhost;database=SalesTestDB;User ID=salesTest1;Password=salesTest1
<configuration>
<connectionStrings>
<add name="DataBaseConnection"
connectionString="server=localhost;database=SalesDB;User
ID=sales1;Password=sales1"/>
</connectionStrings>
</configuration>
This is the code I use to read the whole string value:
string sConn =
config.ConnectionStrings.ConnectionStrings["DataBaseConnection"].ToString();
I want to do the followings:
1) retrieve each value of the "server", "database", "User" and "Password"
2)write back to configuration file:
server=localhost;database=SalesTestDB;User ID=salesTest1;Password=salesTest1