綁定圖片
string pId = getPid(fNo);
if (!string.IsNullOrEmpty(pId))
{
Byte[] byteImage = new Byte[0];
byteImage = (Byte[])(SqlHelperQYL.GetValue(CommandType.Text, "select fileContent from QYLFile.dbo.desProductFile where pId =" + pId));
if (byteImage != null)
{
MemoryStream stmBLOBData = new MemoryStream(byteImage);
pic.Image = Image.FromStream(stmBLOBData);
}
else
{
pic.Image = null;
}
}
else
{
pic.Image = null;
}
if (!string.IsNullOrEmpty(pId))
{
Byte[] byteImage = new Byte[0];
byteImage = (Byte[])(SqlHelperQYL.GetValue(CommandType.Text, "select fileContent from QYLFile.dbo.desProductFile where pId =" + pId));
if (byteImage != null)
{
MemoryStream stmBLOBData = new MemoryStream(byteImage);
pic.Image = Image.FromStream(stmBLOBData);
}
else
{
pic.Image = null;
}
}
else
{
pic.Image = null;
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.