Added a function to read values from database

Also moved 2 functions to Misc.cs