Give the database data to the mainwindow while clicking on "connect".