You are retrieving the data and than displaying it in the grid. It is the grid data which is being used to create a CSV.
Of course, you can do any
CRUD [
^]operation in database, but in CSV only those will be reflected which are done before you called the function
GetData
().