I am building an application that is quite dynamic in nature (a lot of metadata coming from a database for example) and I want to store application parameters in a separate file. An example of a parameter is the column width of a certain column in a view.
I was thinking of creating a Resources file, but they can only store strings. Settings is not an option, because what I want to store are application parameters, not user settings.
What could be a good approach?
if your application dynamically stores data and its huge then better way to sore it is Database table.
if user dependent application setting data then you can use,
External file(ex. MS EXCEL...)
Configuration file of application.
Thank You!
You can use Serialization to store the parameter into registry.
Example:
You pass the String into Byte and serialize it.
When you are deserialize the information, you change the byte back to a string.
More you can find here..
Save serializable object to registry in .net?
Maybe its an opportunity for you..
Related
i am working on c# win form project that stores name,phone No into XML file and display all data back to data grid view. File size is increasing day by day , I need this data multiple times on different forms, and parsing XML file every time is very costly. i would like to load XML file once and then use it where ever i need in my application but i do not know how can i perform this methodology in my project. Kindly guide me about best Approach for this problem.
Caching the parsed XML till it is needed is a solution to this.
Caching is a concept of storing the data in a Cache of the webserver for easy access if the data is being used multiple times, since querying the database each time would be laggy.
You can use the cached data instead of Querying the database each time you need something.
if you already have the XML parsed once, you can store it as a cached variable.
Look at this Question Here. It explains how exactly caching texhnique is used.
Hope this helps....
Thank you!
I am currently creating my first windows phone app (8.1), and am wondering which is the best choice to store data (and retrieve it) :
JSON (or XML you know)
Local Database
I have read a bit about localDB, but I don't know if it is the best choice. I try to create a kind of quiz application, so it is used to store question and pictures.
Thank you
Go with XML, it will be more faster and as you dont need to sync it it will be better option to use.
http://social.technet.microsoft.com/wiki/contents/articles/26688.read-data-from-xml-file-by-using-linq-on-windows-phone-8-1.aspx This link will help you to implement the same.
I'm playing around with vspackages. For now I'm asking how I can implement some kind of a data storage.
Is there a visual studio internal database or somthing which commonly does this?
I just need it to store some data not much but enough for using very simple small database. Maybe a xml file as storage is a posibility ?
Aside from XML which I believe would be a good choice, you can store some data, such as string values and images, in the Properties section of your Visual Studio project.
Double click on Properties from the Solution Explorer and go to the Resources tab. You can then store data in your Resources file (or you'll be given the option to create one first if it does not exist already)
I'm building a site that will consist mainly of large forms for users to fill out. If I want to allow for future forms to be added easily, what's the best way to store the form data?
Storing each value in it's own column is tedious and doesn't allow to easily "drop" in new forms. Is XML a good way to go? Other suggestions?
Thank you.
I will use JSON to save it.But it's difficult to search them.
JSON will use more less disk space,and it's good to read.
So I've seen many questions that talk about the best method to store settings but haven't really seen any that deal with my situation.
Basically my app today has one settings tab with about 75 options/settings. A user is able to basically have different "copies" of these settings (think: dropdown that when you select it, all 75 options are set to whatever was in that associated .xml file).
Right now I just store settings using XML. The problem is that when my application needs to ACCESS a setting, it is literally accessing the UI directly (checkboxes, etc...)
My question: Should I basically created a "has changed" event for every control, and then update the appropriate setting structure (and only save when the user hits save)?
I'm worried that I shouldn't be accessing the UI directly, and it's doing that today ALL over the app. I want to be sure that my new solution is appropriate/how C# was designed.
Thanks in advance!
~ Josh
It sounds like you want to have a class that represents a configuration. Serializing to/from XML allows you to store it in a file or database.
A static singleton can provide the application with the currently active configuration's values. The application should not be checking the UI elements on a non-visible form to get the settings each time one is needed.
Designing the settings form so that it handles a instance of a configuration allows it to be used to display/update the active configuration or a saved configuration. It ought to simplify letting a user load a configuration, modify it, and save it as a new configuration.
And 75 is, as a rule, a lot of settings for a single tab to manage.