I have a C# Windows Forms application. We are using nHibernate version 2.1 with Castle. We are installing our application in a secured vault. Therefore, we need to store the password in encrypted format in the hibernate.cfg.xml file. The C# code then decrypts the password. How can I set the nHibernate connectin string password to the decrypted string value in code?
C# nHibernate programmatically set db password
1k Views Asked by MikeTWebb At
1
There are 1 best solutions below
Related Questions in C#
- Passing arguments to main in C using Eclipse
- kernel module does not print packet info
- error C2016 (C requires that a struct or union has at least one member) and structs typedefs
- Drawing with ncurses, sockets and fork
- How to catch delay-import dll errors (missing dll or symbol) in MinGW(-w64)?
- Configured TTL for A record(s) backing CNAME records
- Allocating memory for pointers inside structures in functions
- Finding articulation point of undirected graph by DFS
- C first fgets() is being skipped while the second runs
- C std library don't appear to be linked in object file
- gcc static library compilation
- How to do a case-insensitive string comparison?
- C programming: Create and write 2D array of files as function
- How to read a file then store to array and then print?
- Function timeouts in C and thread
Related Questions in NHIBERNATE
- Deleting Orphans with Fluent NHibernate
- NHibernate ICompositeUserType split string columns
- NHibernate Second Level Cache for Collections is Slow
- NHibernate - using CreateMultiQuery
- NHibernate.Mapping Exception. No persister for Namespace.className
- Trouble combining Linq Expressions into a Func
- Join Tables using Fluent Nhibernate
- NHibernate - NonUniqueObjectException
- Restrictions.Disjunction().Add(Subqueries.WhereValue(1)
- Nhibernate: Exception occurred getter of id
- Mapping to Date part of Sql DateTime
- Select from Table Valued Function nhibernate
- NHibernate Filtered Child Collection Lazy Loaded even with eager fetch specified
- Parallel Transactions in distinct Session in NHibernate / SQL Server
- updating M:N data using session nhibernate .Net MVC
Related Questions in CONNECTION
- How would I be able to use a file in visual studio project on any computer?
- Connection was not closed. Connection's current state is open
- Android check WIFI status (disconnected or user changed WIFI)
- How to include the current user's path on a file?
- DB2, Hibernate, JPA: Schema does not exist
- I get 530 access denied in ftp connection after some upgrade in my internet connection
- Java telnet connection to request new tor identity
- Why did my application stop connecting using HTTP, and how can I debug it?
- C# send data to remote server
- Apache Server (xampp) doesn't run on Windows 10 (Port 80)
- Node.js : How to check if mongojs connected successfully?
- Failed to connect ... port 80: Timed out, R connection to a Bing API
- Execute POST request until network connection available with Volley on Android
- Draw lines between divs using css border
- Creating a persistent MongDB connection with PyMongo
Related Questions in SET
- Removing duplicates from arraylist using set
- Order-independent Hash Algorithm
- How to count 2 different duplicate values in array - Swift
- CMD specifying columns to save?
- comparison of two sets when repeated in r
- How to use set(data structure) in mongodb console?
- Reversing logic of a product-country mapping
- Storing data in sorted manner in a HashSet
- Generate all combinations of strings and their substrings in a set -- python
- How to access class data in a set of pointers to that class
- Scala set element uniqueness: What to implement for comparison of user defined classes?
- java.util.Set add and remove method signature difference
- retrieve all the smallest strings from a set in python
- Setting a String Variable in SSIS
- Setting a robocopy log file to a variable
Related Questions in PROGRAMMATICALLY-CREATED
- JSF Validators do not work if Random or SecureRandom used to generate component ID
- Why does postgresql fail on single quote
- programmatically generate different static UITableviews
- programmatically Design a View in objective - C
- How to segue *without* storyboard between Master and Detail view?
- Change device name programmatically in android
- android programmatically create layout with header table footer
- Setting constraints on UITableView inside UIView
- Force Main-Layout to Inflate
- Add Style after creating a View programmatically
- Optimize Performance for creating views at runtime
- add layout programmatically in android button click
- Creating UIViews programmatically that respond to touch events
- Setting button style programmatically
- How create buttonAction functions dynamically in Swift
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Your best bet is probably to use
Configuration.GetPropertyandConfiguration.SetPropertyto modify the configuration defined in your hibernate.cfg.xml file:Where
DecryptPasswordMatchis defined as:You'll have to change the regular expression slightly depending on your database engine (this should work for SQL Server).