cursor.select("custid = %1").arg(cid);
Dear my friends... I want to diplay the salesreports only for a determined customer (with custid) into a QDataTable. I use QSqlCursor for doing "select" from a view (false table). I did like this: " void funonseqForm::sejarahSlot() { cid = QSpinBoxCustid->text(); QSqlDatabase * bd = QSqlDatabase::addDatabase("QPSQL7", "OTHER"); bd->setHostName("192.168.23.237"); bd->setDatabaseName("kv"); bd->setUserName("postgres"); bd->setPassword(""); if ( ! bd->open() ) { bd->lastError().showMessage(); } QSqlCursor * cursor = new QSqlCursor("salesreport", true, bd); cursor.select("custid = %1").arg(cid); custdataBrowser->setSqlCursor(cursor, false); custdataBrowser->refresh(); } " but I got this error message in compiling process In file included from .ui/funonseqform.cpp:34: funonseqform.ui.h: In member function `virtual void funonseqForm::sejarahSlot()': funonseqform.ui.h:36: error: invalid conversion from `const char*' to `int' funonseqform.ui.h:48: error: request for member `select' in `cursor', which is of non-aggregate type `QSqlCursor*' make: *** [.obj/funonseqform.o] Error 1 patrixlinux@patrix:~/arsip/proyek/qt/kv/client> how can I change the data type from the text of QSpinBox (QString) into "int"? And how can I do a selection with QSqlCursor.select() but the value of cid variable must be whenever changeable. Thank you very much in advance. __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail
participants (1)
-
Prabu Subroto