I am trying to fetch an image from MS Access DB. Data is fetched correctly but when I'm trying to display some error is showing. My code for display the image is,
...
byte[] photoBytes = (byte[])res[11];
var ms = new System.IO.MemoryStream(photoBytes);
image.Image = new System.Drawing.Bitmap(ms);
...
Error : Additional information: Parameter is not valid.
Can anyone tell me where is the error, or probability of error?
my function is
public OleDbDataReader studentInfo(String adm_no)
{
OleDbConnection con = new OleDbConnection(ConnStr);
con.Open();
OleDbCommand command = new OleDbCommand("SELECT * FROM student_info WHERE adm_no = '"+adm_no+"'", con);
OleDbDataReader res = command.ExecuteReader();
return res;
}