Start with a simpler query:
string SQLQUERY = ("SELECT Naziv FROM HRANA WHERE Id='5'");
CMD = new SqlCommand(SQLQUERY, CON);
and use a SqlDataReader or SqlDataAdapter to read the data. See here for example code:
Connection open and close, how to use correctly ?[
^]
But this won't work:
CMD.Parameters.AddWithValue("@slika", button24.Image);
It won't transfer the image anywhere.
See here:
Why do I get a "Parameter is not valid." exception when I read an image from my database?[
^] for how to deal with images and DBs.