How to save QTime in SQL Server Express table and read it back?

大城市里の小女人 提交于 2019-12-05 11:44:13

For the saving story , I would say the arg method does not work because you ask for %2 but there is only one element to substitute

   query = QString("insert into timeHold(name,timeVar) values ('ABC','%2')").arg(timeString);

I think it should be

query =  QString("insert into timeHold(name,timeVar) values ('ABC','%1')").arg(timeString);

For retrieving from the DB, it's either because you have to specify the format when inserting or when reading

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!