Displaying images in gridview

takwirira

Member
Joined
Dec 21, 2007
Messages
23
Programming Experience
Beginner
The code below is used to get data from a database and displays it in a gridview. the last column l_image displays for example picture1.jpg text. Using code how can I change that to appear as a picture ? Thanks
VB.NET:
Dim da As OleDbDataAdapter = New OleDbDataAdapter("SELECT * FROM lettings", myConnection)
        ' create a new dataset

        Dim ds As DataSet = New DataSet
        ' fill dataset

        da.Fill(ds, "lettings")
        ' Attach DataSet to DataGrid

        GridView1.DataSource = ds
        GridView1.DataBind()
 
I forgot to mention that I had looked at that article already but you have to modify the column template as they show in their diagram. this works fine at runtime but the l_image column shows up as well i.e. you have the picture then you also have picture1.jpg in another column. trying to delete/hide that column at runtime produced all kinds of errors all over again

Thanks
 
Can you post the asp:gridview and code behind so we can take a look at it?

With what I have to go on I'd suggest unchecking auto-generate fields on the GridView and seeing what sort of results you get.
 
Back
Top