V
V
Vlad Osadchyi2018-02-22 19:31:25
C++ / C#
Vlad Osadchyi, 2018-02-22 19:31:25

How can record storage be implemented in C#?

There is such a diary, written as a JS array:

var journal = [
  {events: ["один", "два", "три", "четыре", "пять"],
   result: false},
  {events: ["один", "два", "три", "четыре"],
   result: false},
  {events: ["один", "два", "три", "четыре", "пять"],
   result: true},
  /* и так далее... */

I want to make a similar diary in C# using WindowsForms.
The diary has certain functionality: -
input of new day events({events: ["one", "two", "three", "four", "five"], result: false},)
and several days at once({events : ["one", "two", "three", "four"], result: false}, { events: ["one", "two", "three", "four", "five"], result : true},)
with a textbox.
- determination of the correlation (~~dependence) between a certain event and the result -
after the form is closed, the diary is
deleted - in general, the diary is needed to determine the relationship between events
Question such: how it is possible to implement similar storage of records in C#? I wanted to implement it using an array of objects, but I came across a problem that you can’t add values ​​​​to the end of the array ... I wouldn’t want to resort to creating an XML file for the database .... If you create a List list, then how to push boolean values ​​​​into it and do so that each day was a separate object?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
d-stream, 2018-02-23
@VladOsadchyi

Understand and choose according to your taste: https://msdn.microsoft.com/ru-ru/library/ybcx56wz(...
Well, or in the version for the lazy right in visual studio: Edit -> Paste Special -> Paste Json As Classes
Then the truth will have to think and change the arrays in the resulting classes to the desired collection options

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question