The connection string in the file web.config

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

The connection string in the file web.config

uranium60
Hi all.

I have two separate files
NLog.config
Web.config

I describe the connection string in the web.config file

<add name="AppDB" providerName="System.Data.SqlClient" connectionString="Data Source=(local);Initial Catalog=ExternalWeb;Integrated Security=True" />

I have the connection string in Nlog.config too.
But I want the connection string in Nlog.config is taken from the file web.config

 <connectionString>{WebConfigurationManager}.{ConnectionString["AppDb"]}.{ConnectionString}</connectionString>

How to do it?

Please, give me advice

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: The connection string in the file web.config

Jason LaFlair
Administrator
Use the connectionStringName instead of the straight connectionString - and it will pull that from your <connectionstrings> section.
Loading...