Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8169467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:51:14+00:00 2026-06-06T20:51:14+00:00

I want to create a WinForms application. This application will have many configurable options

  • 0

I want to create a WinForms application.
This application will have many configurable options that will be saved in a database, so they can be persisted across executions (e.g. print settings, design options, etc.).

What approach would you recommend for loading these options, to avoid frequent access to the database?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T20:51:15+00:00Added an answer on June 6, 2026 at 8:51 pm

    If it security isn’t important, you could also have the settings saved in an xml file that your form reads in. You could have a class that loads the properties that you need.

    http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx

    [Serializable()]
    public class Defaults
    {
        public string Description { get; set; }
        public double Tolerance { get; set; }
        public string Units { get; set; }
     }
    
    internal class FormDefaults
    {
    public void LoadSettings()
        {
          string kfileString = @"C:\Default_Settings.xml";
    
          var q = from el in XElement.Load(kfileString).Elements()
                    select new FormDefault()
                    {
                        Description = el.Element("InstrumentDescription").Value,
                        Tolerance = Double.Parse(el.Element("InstrumentMassTolerance").Value),
                        Units = el.Element("InstrumentMassUnits").Value,
    
                    };
            }
        }
    }
    

    That’s pretty rough but I had something similar that worked pretty well and was pretty easy to set up.

    Cheers

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a desktop (winforms) application that uses a Firebird database as a data
I have created a dialog box in my WinForms application. This has many text
I want to create a WinForm application that must draw data coming from a
I want to create a simple 3D line in a WinForms application to improve
I have created a C# WinForms application. It has some additional files that it
I am creating desktop application in winform that will use Sqlite Database. So I
I have a C# winforms application with a sql server backend and want to
I have an NumericTextBox component that extends an TextBox in my WinForms application. To
I am developing a winforms application and I have a scenario where I want
I create a treeview with several nodes in a WinForms application. I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.