views:

18

answers:

1

Hi I'm trying to bind the product pictures to my gridview but nothing shows up... Here's the code:


Using ProductsCtx As New CAJFBLL.ProductEntities

        Dim Produtos = (From P In ProductsCtx.produto _
                       Join C In ProductsCtx.categoria On C.id Equals P.categoria_1.id _
                       Join F In ProductsCtx.FotosSet On F.produto.id Equals P.id _
                       Select New With {.idProduto = P.id, .Foto = P.produtos_fotos, .NomeProduto = P.nome, .Preco = P.precoActual}).ToList


        gvProdutos.DataSource = Produtos
        gvProdutos.DataBind()


    End Using

Already tried with auto generate columns but no dice... Any idea?Thanks in advance!

A: 

That will only work if the P.produtos_fotos is text representing the URL of the image and you are binding to that ImageUrl property of an Image control or similar. If P.produtos_fotos is the actual binary representation of the photo then it is more dificult to do the binding and you need to show the code where you bind the data.

Ben Robinson
Actually the code is in binary format, do i have to make a handler?
Calbertoferreira