The field
reader14[0]
is returning a byte array.
You then convert that byte array to a string, which results in the string
"System.Byte[]"
.
You then pass that string to the
GetInstance
overload which expects a file path. Since it's not a rooted path, the method treats it as a relative path, and tries to find the file:
C:\Users\Bibic Goran\source\repos\BSS\BSS\bin\Debug\System.Byte[]
That file doesn't exist, so you get an exception.
Change your code to load the image from a byte array:
byte[] Memorandum = null;
using (SqlConnection openCon14 = new SqlConnection(Con))
using (SqlCommand cmd14 = new SqlCommand())
{
cmd14.CommandText = "select memorandum from podaci_o_korisniku";
cmd14.Connection = openCon14;
openCon14.Open();
using (SqlDataReader reader14 = cmd14.ExecuteReader())
{
if (reader14.Read())
{
Memorandum = (byte[])reader14[0];
}
}
}
iTextSharp.text.Image logo = iTextSharp.text.Image.GetInstance(Memorandum);