<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Problem when connection to my SQL database to my exam project]]></title><description><![CDATA[<p dir="auto">Hi, so I have a problem to connect my db to my project.<br />
In connection.h I have this:<br />
#ifndef CONNECTION_H<br />
#define CONNECTION_H<br />
#include &lt;QSqlDatabase&gt;<br />
#include &lt;QSqlError&gt;<br />
#include &lt;QSqlQuery&gt;<br />
#include &lt;QtSql&gt;<br />
#include &lt;QFileInfo&gt;</p>
<p dir="auto">class Connection<br />
{<br />
public:<br />
Connection();<br />
bool createconnect();<br />
void connclose();<br />
void connopen();<br />
};</p>
<p dir="auto">#endif // CONNECTION_H<br />
How can I connect the connection.h to my database, which name is "mydb"?<br />
I am kinda new and a bit lost in all this things and infos.<br />
Thank you!</p>
]]></description><link>https://forum.qt.io/topic/139384/problem-when-connection-to-my-sql-database-to-my-exam-project</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Apr 2026 16:44:01 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/139384.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 17 Sep 2022 08:18:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem when connection to my SQL database to my exam project on Sat, 17 Sep 2022 08:41:23 GMT]]></title><description><![CDATA[<p dir="auto">What did you do/tried so far? Did you follow the <a href="https://doc.qt.io/qt-6/qsqldatabase.html#details" target="_blank" rel="noopener noreferrer nofollow ugc">documentation</a>?</p>
]]></description><link>https://forum.qt.io/post/729098</link><guid isPermaLink="true">https://forum.qt.io/post/729098</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Sat, 17 Sep 2022 08:41:23 GMT</pubDate></item></channel></rss>