I am looking at blobs in SQL Server.
Just to start with I am getting a single northwind employee entity.
I want to be able to use the image in the entity and use this with a standard PictureBox
control.
I have tried this
private void button1_Click(object sender, EventArgs e)
{
EmployeeEntity ThisChap = new EmployeeEntity(2);
pictureBox1.Image = byteArrayToImage(ThisChap.Photo);
}
public Image byteArrayToImage(byte[] byteArrayIn)
{
MemoryStream ms = new MemoryStream(byteArrayIn);
Image returnImage = Image.FromStream(ms);
return returnImage;
}
I get this exception
System.ArgumentException was unhandled
Message="Parameter is not valid."
Source="System.Drawing"
Ok I know that the images stored in Northwind are pretty crap but I thought I would get further than this.
There is not much for handling blobs on your site. Most of what I found was how to exclude them in a fetch.