hocam siz yinede bahsedebilirmisiniz biraz nasıl yapıldığından ?
Daha sonra randıman alamazsam da dosya yoluyla denerim
geçen sene yapmıştım tam hatırlamıyorum ama aşşağıdaki kodlardan memory streami kullanmıştım sanırım blob datayı stmBLOBData bağlayıp yapmış bak burdakide
try
{
SqlConnection cn = new SqlConnection(strCn);
cn.Open();
//Retrieve BLOB from database into DataSet.
SqlCommand cmd = new SqlCommand("SELECT BLOBID, BLOBData FROM BLOBTest ORDER BY BLOBID", cn);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds, "BLOBTest");
int c = ds.Tables["BLOBTest"].Rows.Count;
if(c>0)
{ //BLOB is read into Byte array, then used to construct MemoryStream,
//then passed to PictureBox.
Byte[] byteBLOBData = new Byte[0];
byteBLOBData = (Byte[])(ds.Tables["BLOBTest"].Rows[c - 1]["BLOBData"]);
MemoryStream stmBLOBData = new MemoryStream(byteBLOBData);
pictureBox1.Image= Image.FromStream(stmBLOBData);
}
cn.Close();
}
catch(Exception ex)
{MessageBox.Show(ex.Message);}
bu 2.inci kod daha kolay anlamını sağlar
using (SqlConnection sqlConn = new SqlConnection(builder.ConnectionString))
{
sqlConn.Open();
SqlDataAdapter sql = new SqlDataAdapter(
"SELECT Picture FROM Pictures WHERE Pictures.CardID=5", sqlConn);
DataSet ds1 = new DataSet();
sql.Fill(ds1, "Pictures");
DataRow dr = ds1.Tables["Pictures"].Rows[0];
byte[] result = (byte[])dr["Picture"];
int ArraySize = result.GetUpperBound(0);
MemoryStream ms = new MemoryStream(result, 0, ArraySize);
pictureBox1.Image = Image.FromStream(ms);
sqlConn.Close();
}