Reading and Writing data to and from the SQL server