Completed code to read data from the Database