I'm trying to get information to use from a MySQL db. Because it did't work properly I put a hard string in (PR20120002)
string bestand;
MySqlCommand da = new MySqlCommand(cmdText:
"SELECT rapportnr, data
WHERE rapportnr=@Rapportnr", connection: con);
da.Parameters.AddWithValue("Rapportnr", "PR20110002");
MySqlDataReader dossier = da.ExecuteReader();
while (dossier.Read())
{
[...]
}
Before reading the db i get this message:
Message=You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE rapportnr='PR20110002'' at line 1
What am I doing wrong?