mohanakrishnan
4th December 2009, 12:21
hi
im unable to insert a record into the table but im able to execute the select
query..i checked ,the db connection is true..
QSqlDatabase db1=QSqlDatabase::database("ganesh");
if(db1.open())
{
qDebug()<<"connection ok";
QSqlQuery query;
query.exec("insert into waitrequest(bednumber)values('123')");
}
but it shows message like below...
QSqlQuery:: exec: database not open
but if i use select query i get the result!!.
any help is highly respected!!
thanks...:confused::crying:
im unable to insert a record into the table but im able to execute the select
query..i checked ,the db connection is true..
QSqlDatabase db1=QSqlDatabase::database("ganesh");
if(db1.open())
{
qDebug()<<"connection ok";
QSqlQuery query;
query.exec("insert into waitrequest(bednumber)values('123')");
}
but it shows message like below...
QSqlQuery:: exec: database not open
but if i use select query i get the result!!.
any help is highly respected!!
thanks...:confused::crying: