The quick answer is that blobs translate into byte[], so if you import your
image field you should end up with a byte[] property on your entity.
+++ Rick ---
--
Rick Strahl
West Wind Technologies
www.west-wind.com/weblog
"James Page" <> wrote in message
news:B243BE27-E880-49B1-A744-...
> Hi all another LINQ question!!
>
> to retrieve and display sql varbinary images I currently use the following
> code:
>
> Imports System.Data.SqlClient
> Imports System.Drawing
> Imports System.Drawing.Imaging
> Imports System.IO
>
>
>
> Partial Class ShowPicture
> Inherits System.Web.UI.Page
>
> Protected Sub Page_Load(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles Me.Load
> Dim PictureID As Integer =
> Convert.ToInt32(Request.QueryString("PictureID"))
>
> 'Connect to the database and bring back the image contents & MIME
> type for the specified picture
> Using myConnection As New
> SqlConnection(ConfigurationManager.ConnectionStrin gs("ImageGalleryConnectionString").ConnectionStrin g)
>
> Const SQL As String = "SELECT [MIMEType], [ImageData] FROM
> [Pictures] WHERE [PictureID] = @PictureID"
> Dim myCommand As New SqlCommand(SQL, myConnection)
> myCommand.Parameters.AddWithValue("@PictureID", PictureID)
>
> myConnection.Open()
>
> Dim myReader As SqlDataReader = myCommand.ExecuteReader
> If myReader.Read Then
> Response.ContentType = myReader("MIMEType").ToString()
> Response.BinaryWrite(myReader("ImageData"))
>
>
> End If
> myReader.Close()
> myConnection.Close()
> End Using
> End Sub
>
>
> End Class
>
> I'm now trying to use LINQ to replace the sql elements. Can anyone help me
> convert the above using LINQ?