Search code examples
c#arrayspsqlsaving-data

Saving value of an array even after a program is closed/power turns off


There is an array in my program that navigates inputs in database, where to store them.
Problem would be if someone turns that program off or turns the PC off and on again, that array wouldn't be saved, and I really need it saved so it can be used again when program turns back on. Is there any way to store array inside of application so my data is consistant?


Solution

  • Like Others Told You .. Your App Gonna Lose All The Value Of Variables on Restart ... So u Need To Store Your Data Some Where Before Closing You Application ... If Case Of a Big Amount Of Complex Data We Use Some Sort Of a Database , But In Your case If U Want To Save Small Amount Of Data U Can Create a Small File To Contain Your Data .. Whither it's a Csv or XML or even normal text File , You Can Also Encrypt The Date Before Saving If Necessary