How to refer a config file...?

G

Guest

Hai can any one help me on this issue?

I am working on VB.NET. Let us assume, that i use 2 Config files (App.config & App1.config) for different purposes. Using System.configuration i can read the contents of App.config file with out setting the name of the config file in the code,

i.e., I use the following lines,
#######
Imports System.Configuration
..
..

Dim x = ConfigurationSettings.AppSettings("constring")
MsgBox(x)
#######

I get the result. (whatever connection string i set in the config file appears as msgbox)

Here i am not setting the Name of the Config file(as you find from the code.)

Is there any way to set the name of the file to App1.config and read its contents?

Thanks
V.Boomessh
 
G

Guest

only 1 app.config file per application is allowed (except for asp.net apps, which can have nested .config files). i would recommend using a custom configuration section in your configuration file, or just use a different key/name pair for each connection string you need to store, then just reference those from code

ht
jayson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top