Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Persian
  4. Sqlite اتصال به بانک

Sqlite اتصال به بانک

Scheduled Pinned Locked Moved Persian
2 Posts 2 Posters 1.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hamedaz
    wrote on last edited by
    #1

    @

    QSqlDatabase db = QSqlDatabase::addDatabase( "QSQLITE" );

    db.setDatabaseName("mydatabase.sqlite");

    if(db.open()){
    qDebug()<<"opend";

    QSqlQuery qry;
    
    if(qry.exec&#40;"SELECT * FROM h"&#41;&#41;{
    
          while(qry.next(&#41;){
    
                 qDebug()<< qry.value(12).toString();
    
            }
    
        }
    
        else{
    
             qDebug()<<"eroor"<<qry.lastError().text();
        }
    
    db.close();
    

    }
    else{

    qDebug()<<"eroor"<<db.lastError().text();
    }

    @

    opend
    no such table:h unable to execute statement

    هر نامی برای بانک اطلاعاتی انتخاب می کنم

    پیغام میده که بانک اطلاعاتی بازمیشه

    1 Reply Last reply
    0
    • B Offline
      B Offline
      bs994
      wrote on last edited by
      #2

      سلام
      رو بسازی tableفکر کنم اول باید
      با این مثلا
      qry.exec("create table h(one varchar(10),two smallint)")

      Real Eyes Realize Real Lies .

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved