PDA

View Full Version : I have a problem to modify table



Abk
31st May 2007, 19:33
Hello.

When I trying to modify table like
this->m_DbModel->record(0).setValue("dsc",text);
where m_DbModel is QSqlTableModel, text is QString
i have no changes in the database.

When I triyng to modify data directly in the QTableView the changes are commited into the database.

In the 1st and 2nd cases I use this->m_DbModel->submitAll() operator to save data.

How do I need to modify my 1st code to save changes into the database?

Thank you.

Abk
31st May 2007, 20:11
this->m_DbModel->record(0).setValue("dsc",text)
do not work

but works
this->m_DbModel->setData(index,text);