Encrypted Connection String Objects – New GDN User Sample
It took a while, but I finally finished a version of my Encrypted Connection String Objects that I could release to the public, and also handles SQL Server Connection Strings. You can get download it over at GDN.
It is written in C# (sorry no VB.Net yet), and the downloaded version uses VS.Net2K3, but there is nothing in the code that requires .Net 1.1. The basic premise behind the code was:
- Create a generic ConnectionString class that handled encapsulation of the form and format of connection strings. I stuffed them in config files, so I can use the same ConnectionString class in both Win apps and Web apps. I then updated the class to handle encryption and decryption of the connection string.
- Create specific implementations connection string classes for the different types of connection strings, and expose the different sections as properties. I also add code to set default values to the ones in the documentation, and added edit checking of the different sections.
- Create a WinForm app that would build and edit the connection string sections in config files.
All three parts are included in the downloaded code example. And to use this code in your data access code, you only need to add one line of code.
The code is all from my forthcoming eXenstible Data Objects (XDO) data access layer, that will get released via GDN as soon as I finish adding SQLServer support to the already existing Oracle support. XDO is nothing like the other Data Access Application Blocks I’ve seen.
DonXML