You might want to look at the example in this thread for how to writing data back to the data source: