i am trying to link QT with DB its saying its connected and opened but when am trying to fetch information of a table its doing nothing.

#include<QtCore/QCoreApplication>
#include<QtSql>
#include<QtDebug>
int main(int argc, char *argv[])
{
QString servername="MyFirstConn";
QString dbname ="Dataset";
QSqlDatabase db= QSqlDatabase :: addDatabase("QSQLITE");
db.setConnectOptions();

QString dsn = QString ("Driver={Sql Native Client}; SERVER =%1; DATABASE =%2; Trusted_Connection=Yes;").arg(servername).arg(dbna me);

db.setDatabaseName(dsn);
if(db.open())
{

qDebug ()<<"opened!";
QSqlQuery qry;
if (qry.exec("Select * from Dataset.ImageDataset!!!"))
{
while(qry.next())
{
qDebug()<<qry.value(2).toString();

}

}
else
{
qDebug ()<<"Error= "<< db.lastError().text();
}
qDebug ()<<"Closed!";
db.close();
}
else
{
qDebug ()<<"Error="<< db.lastError().text();
}
}
Kindly help.
Thanks