How to search in database
-
I have a database in which five fields FileName,Tag,Date,Time and Description about files.
now i want to search the database from description. for this i have added a lineedit_description and a search button in my gui.when we will search by description then i want to show all the data they have same description in a tableview.please tell me how i can do this. thanks in advance. -
What kind of database are you using?
-
Sqlite ...
-
Take look on "this example":http://qt-project.org/doc/qt-5/qtsql-sqlbrowser-example.html it shows how to send a query to a database and how to display it.
Full set of database example is "here":http://qt-project.org/doc/qt-5/examples-sql.html -
In addition to the links posted above I would also suggest:
- the SQLite documentation for "SELECT statement":http://www.sqlite.org/lang_select.html
- "Qt SQL Database Drivers":http://qt-project.org/doc/qt-5/sql-driver.html