This is called "persistence":
https://en.wikipedia.org/wiki/Persistence_%28computer_science%29[
^].
Basically, when your terminate your program somehow, your data is lost. The data is stored on
RAM, which is reused later by the code and data of other applications. Note that not all OS work this way. Some of the
persistent OS always store the whole state machines, and all applications, when restarted, get the same data as before termination, and this data is stored permanently, until the application discards it explicitly. As you are using C#, chances are, the system you are using is not like that.
You need to save your data in some database, or
serialize and store in a file or some other stream, to restore it back later. Relational databases are usually used in .NET via ADO.NET, and the streams-based persistence is organized through
serialization. Please see:
https://en.wikipedia.org/wiki/ADO.NET[
^],
https://msdn.microsoft.com/en-us/library/aa286484.aspx[
^],
https://en.wikipedia.org/wiki/Serialization[
^],
https://msdn.microsoft.com/en-us/library/7ay27kt9%28v=vs.110%29.aspx[
^],
https://msdn.microsoft.com/en-us/library/ms733127%28v=vs.110%29.aspx[
^] (please read this part thoroughly, this is the fundamentally important serialization technology).
—SA