Converting Sql.LINQ.Binary to Byte()

   1: Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
   2:         If Not String.IsNullOrEmpty(HttpContext.Current.Request.QueryString("imageID")) Then
   3:             Dim imageID = HttpContext.Current.Request.QueryString("imageID")
   4:             Dim db As New AuctionsDataContext
   5:             Dim result = From img In db.Images _
   6:                          Where img.imageID = imageID _
   7:                          Select img.image
   8:  
   9:  
  10:             HttpContext.Current.Response.BinaryWrite(CType(result.First.ToArray, Byte()))
  11:             context.Response.End()
  12:         End If
  13:     End Sub

 

Ref: http://weblogs.asp.net/bryansampica/archive/2007/11/29/converting-sql-linq-binary-to-byte.aspx

posted @ 2008-04-14 20:42  Vincent Yang  阅读(1159)  评论(0编辑  收藏  举报