Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qsqltablemodel incompatible data types
Qt 6.11 is out! See what's new in the release blog

Qsqltablemodel incompatible data types

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 916 Views 1 Watching
  • 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.
  • M Offline
    M Offline
    matobodo
    wrote on last edited by
    #1

    I have a simple form with button and some line edits and listview.
    In listview users can select items and in line edits edit their parameters.

    @
    int row = listView->selectionModel()->currentIndex().row();
    QString text = ui->lineEdit->text();
    sqlTableModel->setData(sqlTableModel->index(row,3),title,Qt::EditRole);
    sqlTableModel->submitAll(); //when this line is execeute i get an error
    @

    error:
    QODBCResult::exec: Unable to execute statement: "[Microsoft][SQL Native Client][SQL Server]The data types varchar(max) and ntext are incompatible in the equal to operator. [Microsoft][SQL Native Client][SQL Server]Statement(s) could not be prepared."

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Moderators Qt Champions 2024 Qt Champions 2022 Qt Champions 2017
      wrote on last edited by
      #2

      Issue is coming from Microsoft SQL where nnext is deprecated nvarchar. You can hit the google and fix this issue with Microsoft SQL. I saw many solutions available for this to fix. You can check the following link as well.

      "http://stackoverflow.com/questions/3543570/ntext-comparison":http://stackoverflow.com/questions/3543570/ntext-comparison

      Dheerendra
      @Community Service
      Certified Qt Specialist
      https://www.pthinks.com

      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