【求助】二进制图片读取的问题。'System.Data.Linq.Binary' to type 'System.Byte[]'

 

想使用Gridview显示图片。

 byte[] photo = Response.BinaryWrite(DataBinder.Eval(e.Row.DataItem, "image"));报异常如下。

'System.Data.Linq.Binary' to type 'System.Byte[]'

 

Code

 


  

 

说明:数据库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;
}
}

 

不知道类型如何转换才是。。。。


posted @ 2008-10-20 21:01  AlexLiu  阅读(3471)  评论(2编辑  收藏  举报