What is the best approach to allow users to configure database connections? The connection could either be SQL or Oracle. I'm building a WPF desktop application. Ideally this is the type of setting that is configured once and then forgotten about.

Some ideas I've had-

  1. Just have a config file and have the user edit the connection string in there.
  2. Have a configuration/connection tab in my application and have the user enter a connection string.
  3. Have a configuration/connection tab in my application and user enters user name, password, server, etc all in different fields and I build the connection string.
  • Options 1 and 2 seem potentially error prone. I would suggest you have each data item entered separately as in option 3, and ideally allow the user to "Test the Connection" at that same point via a button, with feedback as to whether the connection was successful or not. I've always liked that instant gratification :)
    – Snubian
    Jun 13, 2013 at 2:15
  • 1
    Option 5: re-use (or re-engineer) existing connection dialogs (since you're talking about WPF, I presume it's Windows). Don't re-invent the wheel; Microsoft has done a lot of research on usability and whatever details there are needed. Jun 13, 2013 at 4:52
  • The functionality reminds me about FileZilla FTP client and how it solved managing FTP-connections. It's a free download @ portableapps.com.
    – John
    Jun 13, 2013 at 5:23
  • @DeerHunter thanks for the suggestion. I found the Microsoft Data Connection Dialog that was released in 2010 that I might be able to use. I was hoping to have a single Window instead of a dialog, but code reuse from Microsoft is probably best. (msdn) archive.msdn.microsoft.com/Connection (nuget) nuget.org/packages/DataConnectionDialog
    – Darlene
    Jun 13, 2013 at 14:29

1 Answer 1


Squirel SQL Client Add Alias Dialog

Squirel Sql client does this exceptionally well, a drop down list with an array of possible "databases" each when chosen will put a sample connection url into the URL text field already formatted as that particular database's connection string, and not to forget to mention a button for testing that the connection works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.