OleDbConnection conn = new OleDbConnection(connectionString);
OleDbCommand SQLCommand = new OleDbCommand();
conn.Open();
string getpwd = textBox3.Text.ToString();
string query2 = "select * from Table1 where Filename= '" + getpwd + "'";
Console.Write(query2);
OleDbCommand s = new OleDbCommand(query2, conn);
OleDbDataReader bReader = s.ExecuteReader();
if (textBox3.Text == "")
{
MessageBox.Show("Please Enter the Image name to retrive!!");
}
else if (bReader.Read())
{
byte[] b = new byte[0];
b = (Byte[])(bReader["imgname"]);
MemoryStream ms = new MemoryStream(b);
pictureBox1.Image = Image.FromStream(ms);
}
else
{
MessageBox.Show("Please Enter Valid Image name!!!");
}
conn.Close();