View Full Version : regarding database

18th September 2010, 12:18
hi everyone! I have created a simple database and in it a table with the fields id,name,address. then i have entered a name and address for a id. Now what i want to do is, i want to extract the stored name from the database and store it in a variable (of type QString). Well, how to do? I'm not getting any idea.:confused:

18th September 2010, 12:29
You just need to create a connection to the database, like you did before creating it, then use QSqlQuery to get your data.

Look at examples here: http://doc.trolltech.com/4.5/qsqlquery.html#details