Sql query blocks your application so that the progress bar doesn't have a chance to update itself. You can experiment with executing the query in a thread.