How to connect to SQL Server 2008 with qt?
After trying for so much time, I finally managed to get this to work ... here's what I did :
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC3");
db.setDatabaseName("DRIVER={SQL Server};Server=ITPL_PC1;Database=Test;Uid=sa;Port=1433;Pwd=*******;WSID=.");
db.open();
QSqlQueryModel *model = new QSqlQueryModel;
QString query = "insert into qttable(PID) values('ARINDAM')";
model->setQuery(query, db);
db.close();