how can i send a text which contain ' to database
i use a qsqlquery but there is a error if the text contain '
please help me
Haven't tested it, but I would try to escape the character using e.g. it's ascii code
Hope it helps
thank you SGaist
so i must search in the string for the ' and change it with her code ascii?
you can use as following :
use \' escape sequence
QString strQuery("insert into emp values(2,'1989-02-02','amit','\'vermas\'','M','2014-01-01')");
after executing above using .exec();
in DB it will send as 'verma' in respective column.
hope it helps
thank you all
so to solve this problem i used binvalue
bindValue() is indeed the more or less only correct way to proceed.
yes it's a correct way