DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Dynamic OleDbConnection problem: windows app.config

  1. #1
    Join Date
    Apr 2004

    Question Dynamic OleDbConnection problem: windows app.config

    This seemed to work before but now acting up??? Have a VB.NET 2003, windows form, OleDbConnection, due to security need to decrypt connection string pulled from app.config before passing to Access database file. I do this via a call to a function in a module:

    Dim EncryptConnectionString As String

    EncryptConnectionString = CType(configurationAppSettings.GetValue("OleDbConnection1.ConnectionString", GetType(System.String)), String)

    Me.OleDbConnection1.ConnectionString = decrypt(EncryptConnectionString)

    Though this used to work seems now to be in a Catch 22 situation. I can enter the code above in the #Region " Windows Form Designer generated code ", but it unsets the dynamic connection property in the IDE. If I set the dynamic connection property in the IDE to map to a key in the app.config file, i.e., OleDbConnection1.ConnectionString, it rewrites the #Region " Windows Form Designer generated code " and erases over the decryption code above.

    Any thoughts? Can I do call the decryption outside the Windows Form Designer generated code ?? Any other solutions? VERY IMPORTANT!! ANY RESOLUTIONS, THOUGHTS, GUESSES APPRECIATED Any other way to decrypt a connection string?

  2. #2
    Join Date
    Dec 2003
    I would definitely change the ConnectionString outside of the Windows Form Designer generated code. You should be able to do this during application startup.
    Microsoft MVP (Visual Basic)

Similar Threads

  1. Problem getting servlets to be dynamic
    By partyk1d24 in forum Java
    Replies: 0
    Last Post: 11-09-2006, 06:08 PM
  2. Problem with Drag and Drop
    By Jim Pragit in forum .NET
    Replies: 5
    Last Post: 08-10-2005, 07:16 AM
  3. Windows Service problem
    By Shawn W Knight in forum .NET
    Replies: 0
    Last Post: 08-09-2002, 12:32 PM
  4. Replies: 0
    Last Post: 04-29-2002, 07:39 AM
  5. Problem with retrieveing windows username
    By Iain Munro in forum ASP.NET
    Replies: 1
    Last Post: 01-08-2002, 02:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center