APP.config

liunx

Guest
hi ,
i am krishna,

i am using app.config file for my windows application in order to set the connection string,but when i run my application the it is not checking for the database in the debug folder but in other drives in the system,i am not getting any error with other database which is also in the debug folder ,i am using the key values correctly only,i am unable to understand why it is happen to one database and it is not happening to other database which are both in the same debig folder.

it would be great if someone would help me out.

bye.Krishna,

You have to create link to the class System.Configuration.AppSettingsReader;

so it would be:

using System.Configuration;

AppSettingsReader MyConfigFile = new AppSettingsReader();
string ConnectionString = MyConfigFile("ConnectionString");

this should return the value of the node ConnectionString which is defined in your app.config;

Apologies if it's slightly incorrect, i'm just starting my self, and unfortunately my Visual Studio has gone fubar so I am currently reinstalling it.

Have a look around, there will be loads of stuff in msdn.

Gav
 
Back
Top