hi everyone,
i am using the code below in a green font, to retrieve and image from my access database into my picturebox1, i want to send a copy of the image in its JPEG format to a folder "C:\images" can any one help me out!!
OleDbConnection
cn1 = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=C:\Users\katoto\Documents\Visual Studio 2010\Projects\Genesis
Philcollins\Genesis Philcollins\bin\Debug\thyfarm.accdb;Jet OLEDB:Database
Password=Kyozi");
string sql1 = ("select
assetimage from Assetinformation where Uniqueassetno like '" +
textBox4.Text + "'");
OleDbCommand cmd1 = new OleDbCommand(sql1,
cn1);
cn1.Open();
OleDbDataReader sdr = cmd1.ExecuteReader();
if (sdr.HasRows)
{
sdr.Read(); // read first
row
// textBox2.Text =
sdr[0].ToString(); // read first column
byte[] getimage = (byte[])sdr[0]; // read third column
MemoryStream ms = new MemoryStream();
ms.Write(getimage, 0,
getimage.Length);
ms.Seek(0, SeekOrigin.Begin);
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
pictureBox1.Image = Image.FromStream(ms);
}
sdr.Close();
thanks