I'm trying to change up how the application I'm working on currently gets its database settings. Right now, all the settings are saved in a plain text file. So I'm trying to get it to work with a config file, but the following code, which I copied and pasted directly from the Visual Studio documenation, refuses to compile.
--
using System;
using System.Configuration;
class Program
{
static void Main()
{
ConnectionStringSettings settings;
settings = ConfigurationManager.ConnectionStrings["DatabaseConnection"];
if (settings != null)
{
Console.WriteLine(settings.ConnectionString);
}
}
}
--
It can't find ConnectionStringSettings which is supposed to be in System.Configuration. Anybody know what's going on?
What's the best way to store sensitve modifiable settings anyway? The documentation gives a walkthrough for encrypting ASP.NET config files, would I be able to do the same thing with application config files?
--
using System;
using System.Configuration;
class Program
{
static void Main()
{
ConnectionStringSettings settings;
settings = ConfigurationManager.ConnectionStrings["DatabaseConnection"];
if (settings != null)
{
Console.WriteLine(settings.ConnectionString);
}
}
}
--
It can't find ConnectionStringSettings which is supposed to be in System.Configuration. Anybody know what's going on?
What's the best way to store sensitve modifiable settings anyway? The documentation gives a walkthrough for encrypting ASP.NET config files, would I be able to do the same thing with application config files?