string constr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=.\\PIS(ACU).mdb;";
Con = new OleDbConnection(@constr);
Con.Open();
Com = new OleDbCommand();
Com.Connection = Con;
{
Com.CommandText = "SELECT Picture FROM <pics> WHERE Patient_Id =" + val + ", Con)
using (SqlDataReader reader = cmd.ExecuteReader())
{
if (reader.Read())
{
byte[] picbyte= reader["Picture"] as byte[] ?? null;
if (picbyte!= null)
{
using (MemoryStream ms = new MemoryStream(picData))
{
// Load the image from the memory stream. How you do it depends
// on whether you're using Windows Forms or WPF.
// For Windows Forms you could write:
System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(ms);
}
}
}
}
}