Posts

Showing posts with the label system.configuration

Checking for duplicate keys using WPF and C#

Image
Checking for duplicate keys using WPF and C# I'm creating an application that will look AppSettings, pull those keys and their values up into a DataTable, use the DataTable to edit or add keys, check for duplicate keys once edited, and save them back to into AppSettings . I currently have three buttons. One is ProgrammedBy which pulls up a separate data table, a View App Settings within App.config and display it on a data table, and finally an Update Settings button that checks for duplicate keys after the information is entered on the DataTable then save the keys and their values back to AppSettings: AppSettings ProgrammedBy Here is a list of the keys and values within in the App.config file. Note I have given a key a duplicate name: I'm using a nested for loop on the part where it checks for duplicate keys. The System.Collection library only checks the last duplicate key. It totally ignores the first one. When I drill down or hover my mouse over the items variable, Rows/Resu...