想使用Gridview显示图片。
byte[] photo = Response.BinaryWrite(DataBinder.Eval(e.Row.DataItem, "image"));报异常如下。
'System.Data.Linq.Binary' to type 'System.Byte[]'
));
}
说明:数据库SQLserver image字段是 varbinary(MAX) 类型。
MODEL使用LINQ 写的
private System.Data.Linq.Binary _image;
[Column(Storage = "_image", DbType = "varbinary(500)")]
public System.Data.Linq.Binary image
{
get
{
return this._image;
}
set
{
this._image = value;
}
}
不知道类型如何转换才是。。。。