Inserting rows in the specified database table
In this recipe, we will be learning to insert rows into a table. We assume a table called Users consisting of two columns, EmailAddress and Password, already exists in a database called ECommerce.
After entering the email address and password in the respective Line Edit widgets, when the user clicks the Insert Row button, the row will be inserted into the specified database table.
How to do it…
Here are the steps to insert rows into a database table that exists in SQLite:
- Let's create an application based on the
Dialog without Buttonstemplate. - Add five
QLabelwidgets, fourQLineEditwidgets, and oneÂQPushButtonwidgets to the form by dragging and dropping fiveLabelwidgets, fourLine Editwidgtes, and oneÂPush Buttonwidget on the form. - Set the
textproperty of the first fourLabelwidgets toEnter database name,Enter table name,Email Address, andPassword. - Delete the
textproperty of the fifthLabelwidget this is established through code. - Set...