
Originally Posted by
nagabathula
sir i understood now.. you are trying to remove the last comma from the string names which will be appended..
i am still compiling the code..
hi,
I strongly recommend u to use QStringList instead of QVector for this purpose.
then code will be like the following
channalNames << "col1" << "col2" << "col3" << "col4"; //ur channels
QString colName
= channalNames.
join(",");
// now colName will have col1,col2,col3,col4 QSqlQuery sq1
("SELECT ""+ colName +"" FROM myDatabase rowid = (" + QString::number(rowcnt
) + ")");
QStringList channalNames;
channalNames << "col1" << "col2" << "col3" << "col4"; //ur channels
QString colName= channalNames.join(","); // now colName will have col1,col2,col3,col4
QSqlQuery sq1("SELECT ""+ colName +"" FROM myDatabase rowid = (" + QString::number(rowcnt) + ")");
To copy to clipboard, switch view to plain text mode
there is no need to remove last comma ,etc.
QStringList is simple and effective 
Hope it helps
Bala
Bookmarks