Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-8" ?>
- <configuration>
- <appSettings>
- <add key="MyKey" value="MyValue"/>
- </appSettings>
- <connectionStrings>
- <add name ="MyHost"
- providerName="System.Data.Sql"
- connectionString="Data Source=(local)SQLEXPRESS;Initial Catalog=Northwind;
- Integrated Security = true; User ID=Admin;Password=P@ssw0rd;
- Connection Timeout=2;Encrypt=True;TrustServerCertificate=True" />
- </connectionStrings>
- </configuration>
- ConnectionStringSettingsCollection settings = ConfigurationManager.ConnectionStrings;
- if(settings != null)
- MessageBox.Show(settings[0].ConnectionString, "ConnectionString");
- string s = ConfigurationManager.AppSettings["MyKey"];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement