Configuring for a wide audience
As you've been working with your own local databases, you know right where everything is and it's been quick and easy to just set the database connection string directly. But your users will install your software in different folders or on older operating systems that have different default paths. Hardcoding a connection string with a path and port is always a setup for problems.
We have not addressed this throughout the book as we've been focusing on other concepts but as we look toward distributing our servers and apps to other systems, we have to take this into consideration and allow flexibility in where files and databases will be and which ports may or may not be available.
Enter configuration settings. There are many approaches to how and where to store these. Some apps create a small database file in a publicly accessible area of the local device. Others store settings in the Windows registry. Since the Windows registry is...