Hello every one. 
i have a doubt , how can to insert data which is in a QList<QString> into a database.
i have created the table and the columns for it in connection.h file.. i need to insert the continuous data in the string for 500 columns with a time stamp in the end.. but it is not working what i am doing wrong here. pls help me out with it.
for(int p = 0; p < rdata.count();p++) // rdata is QList<QString>
{
lstdata = rdata.at(p); // lstdata is a QString
}
QString sp
("INSERT INTO thdata values (%1)");
sp = sp.arg(datacount)
.arg("'" + lstdata + "'");
m_query.exec(sp);
datacount++;
lstdata.clear();
for(int p = 0; p < rdata.count();p++) // rdata is QList<QString>
{
lstdata = rdata.at(p); // lstdata is a QString
}
QString sp("INSERT INTO thdata values (%1)");
sp = sp.arg(datacount)
.arg("'" + lstdata + "'");
m_query.exec(sp);
datacount++;
lstdata.clear();
To copy to clipboard, switch view to plain text mode
thank you
Bookmarks