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#
- How to call a C language function from x86 assembly code?
- What does: "char *argv[]" mean?
- User input sanitization program, which takes a specific amount of arguments and passes the execution to a bash script
- How to crop a BMP image in half using C
- How can I get the difference in minutes between two dates and hours?
- Why will this code compile although it defines two variables with the same name?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Why can't I use the file pointer after the first read attempt fails?
- #include Header files in C with definition too
- OpenCV2 on CLion
- What is causing the store latency in this program?
- How to refer to the filepath of test data in test sourcecode?
- 9 Digit Addresses in Hexadecimal System in MacOS
- My server TCP doesn't receive messages from the client in C
- Printing the characters obtained from the array s using printf?
Related Questions in NHIBERNATE
- Possible to get nested proxies of hierarchical data in one query using NHibernate?
- ISession.Load(id) "Creating a proxy instance failed" "Sequence contains more than one matching element"
- RedundantArgumentMatcherException in azure pipeline when field is used and not when using local variable
- Specify entity / SQL insertion order in NHibernate transaction without multiple flushes
- NHibernate: Entities Mapped Incorrectly Despite Correct Configuration
- How to get all objects with parameters of other tables in NHibernate?
- Which version of Nhibernate works with .NET 6 & Visual Studio 2022?
- Writing NetTopologysuite Point geometry to PostgreSQL with fluent nhibernate fails due to custom type mapping
- nHibernate: SessionFactory.Evict(type) not working as expected
- Nhibernate - eager fetching collections in collections with linq
- NHibernate new version upgrade
- How to reference both entities when having only one column in one table in Fluent Nhibernate?
- ORA-22835: Insufficient buffer size for converting CLOB to CHAR or BLOB to RAW (actual: 81863, maximum: 2000)
- NHibernate to return records, that contain a value in the List<string>
- Select items from a group by where count is larger than 1
Related Questions in CONNECTION
- MongoDb not connecting C#
- Frontend fetching data from unexpected localhost address despite proxy configuration
- recognize_google fails with WinError 10060
- April fools - PsExec (PsTools)
- Unable to resolve service name to its IP inside kubernetes cluster
- Is there a way to create connection pooling in codeigniter 3 using custom mysqli driver?
- Error in releasing pool connection in node project
- Is there a way in Laravel to use multiple connections simultaneously in a combined manner?
- Not able to inject RedisCache/SyncCache/StatefulRedisConnection beans in micronaut 4.2.1 version
- How to send a big array to a client faster
- Connection Type not visible in Airflow connections
- Cannot connect to an Oracle XE database from C#
- SSMS Update Causes Connection Failure and Exception Error
- Mutual connections in Strapi
- Microsoft SQL Server Express Java Connection
Related Questions in SET
- mondrian3 set by aggregate
- Produce a combination of all permutations for 4 groups of data with 4 unique values contained
- How to find the difference between two python files and write output with file source information
- Is there a problem with my code? Finding null pointer Exception
- The difference between set definitions in Python
- Leetcode BFS Set insertion giving TLE (200. Number of Islands)
- set.find() not working for ordered multiset
- TinyMCE custom toolbar button to set CSS property of selected text
- Find a bit with no duplicates among multiple bits in Java
- Algorithm for comparing two sets of sets
- Order of a set in Python
- Proof on inductive sets
- Remove all elements from a set greater than a number
- Trying to prove a set to be the union of its singleton sets in Dafny
- Declaring a set of a set in Mosel
Related Questions in PROGRAMMATICALLY-CREATED
- Is it possible to programmatically create a material view (e.g. button) and use a defined style so that it looks like when created by a layout?
- Is it possible to programmatically extract all key value pairs from a style without defining the single attributes?
- How do I add new notification sound programmatically on Android
- How can I do a CellDoubleClick event on my datagridview that I created programmatically? C#
- NSToolbar with NSView subclass custom view does not render in customise toolbar panel
- Design elements in xml and java the result is not equal
- Toggling an UISwitch Programmatically
- <input> picker was blocked due to lack of user activation when programmatically trying to open File Load dialog
- WPF add Interaction Trigger programmatically in the DataTemplate
- Store arguments of a command in variable
- Programmatically creating views for Android layout. On back button all EditText controls get the same value
- Set state for dynamically generated component in React
- ContentView isn't Showing up Inside ScrollView
- How can I programmatically seamlessly share a clients google calendar with a service account as automatically as possible
- dotnet ef scaffold Unrecognized option '-t firstTable -t secondTable' - pass arguments stored in a string
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 # Hahtags
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).