Hi John, As far as I can remember, this should be
this.sqlConnection1.ConnectionString = (string) System.Configuration.ConfigurationSettings.AppSettings["YourSetting"] HTH, -Ingo Author of "Advanced .NET Remoting" http://www.dotnetremoting.cc > -----Original Message----- > From: John Sands [mailto:[EMAIL PROTECTED]] > Sent: Saturday, April 27, 2002 10:16 PM > To: [EMAIL PROTECTED] > Subject: Re: [DOTNET] config file for console app > > > >> If you console app is myapp.exe, name the file myapp.exe.config > >> If you are using VS.Net, then just add the config file to > your project > >> as app.config. VS.Net will then automagically copy that > file as <your > >> app name>>.exe.config > > This worked, thanks. But I still can't access the setting from code. > The examples do this: > > this.sqlConnection1.ConnectionString = > ((string)(configurationAppSettings.GetValue("sqlConnection1.Co > nnectionString", typeof(string)))); > > But this gives a compile error on "configurationAppSettings". Where > does this thing come from? > > Thanks, > John > > You can read messages from the DOTNET archive, unsubscribe > from DOTNET, or > subscribe to other DevelopMentor lists at http://discuss.develop.com. > You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.