I want to retrieve a image stored in MS Access database as an OLE object.
while using a OledbDatareader and getValue method, its returning me a byte array.
how can i use this array to display my picture as it is in a picturebox on a form.
private void pictureBox1_Click(object sender, EventArgs e)
{
OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\\db1.mdb");
conn.Open();
string query = "select * from Images_Table";
OleDbCommand comnd = new OleDbCommand(query, conn);
OleDbDataReader rdr = comnd.ExecuteReader(CommandBehavior.SequentialAccess);
while (rdr.Read())
{
label1.Text = (string)rdr.GetValue(0);
pictureBox1.Image=rdr.GetValue(1); //ERROR !!!
//rdr returns a byte array.
//How can i set the image in picturebox1.
}
rdr.Dispose();
conn.Close();
}
Please help....
Thank You.