You can just do the following:
var connection =
System.Configuration.ConfigurationManager.
ConnectionStrings["Test"].ConnectionString;
Your assembly also needs a reference to System.Configuration.dll
More Related Contents:
- How can I add user-supplied input to an SQL statement?
- ExecuteReader requires an open and available Connection. The connection’s current state is Connecting
- Is there a difference between “throw” and “throw ex”?
- C# DLL config file
- WPF global exception handler [duplicate]
- App.Config change value
- SQLite Database Locked exception
- Read connection string from web.config
- Use XML includes or config references in app.config to include other config files’ settings
- Exception when AddWithValue parameter is NULL
- Handling ExecuteScalar() when no results are returned
- What is IMEX within OLEDB connection strings?
- Help with a OleDB connection string for excel files
- How can I catch a 404?
- Use of SqlParameter in SQL LIKE clause not working
- How can I retrieve a list of parameters from a stored procedure in SQL Server
- How to check if connection string is valid?
- Thread safety for DataTable
- What’s better: DataSet or DataReader?
- Using SqlDataAdapter to insert a row
- How do I re-write a SQL query as a parameterized query?
- Update app.config system.net setting at runtime
- Check if a SQL table exists
- Consume a SOAP web service without relying on the app.config
- Unable to find the requested .Net Framework Data Provider – SQLite
- Changing App.config at Runtime
- How do I extract data from a DataTable?
- Persist Security Info Property=true and Persist Security Info Property=false
- Reading a date using DataReader
- What ‘length’ parameter should I pass to SqlDataReader.GetBytes()