General information
Category:
The Mere Mortals .NET Framework
I found a way to do this exactly the way I wanted.
Here are the steps required.
1. create your own mmDatabaseManager subclass (see Overriding Factory Methods in help)
2. override the GetConnectionString method
3. paste all the originl code back in (I’m working in VB so I had to convert the code to VB this turnned out to be the hardest part)
4. just ater the second check of mmString.Empty(ConnectionString) conditional (the one that decides if a exception should be thrown) place this line of code
5. ConnectionString = mmEncrypt.DecryptString(ConnectionString, )
6. replace your Key with the Key you want to use for the encryption “hi”, “eatatjoes” whatever as long as it’s the same key you use to encrypt the data.
7. in order to get the original encrypted string top the config file add this to the top of the method
Dim setit As String = mmAppBase.AppSettingsMgr.GetSectionSetting("databases", Me.DatabaseSetKey + databaseKey + "\Connection")
'Debug.WriteLine(mmEncrypt.EncryptString(setit, "hi"))
And set a breakpoint
Run it and step through the code until you debug writ the encrypted string to the debuger and stop.
Copy and paste this into the value section of the connection key.
Remove or remark the lines added in step 7 and your done!
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only