Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-8" ?>
- <configuration>
- <connectionStrings>
- <add name="my_conn" connectionString="Data Source=xx.xx.xx.xxx;Initial Catalog=some_db;User ID=xxx;Password=yyy" />
- </connectionStrings>
- </configuration>
- // Assume failure.
- string returnValue = null;
- // Look for the name in the connectionStrings section.
- ConnectionStringSettings settings = ConfigurationManager.ConnectionStrings["my_conn"];
- // If found, return the connection string.
- if (settings != null)
- returnValue = settings.ConnectionString;
Add Comment
Please, Sign In to add comment