Sir,

My DataBase field name "PerID" and "Imagepath"

In DataGridview, I want to show "PerID" and Image (Not file path)

Recommended Answers

All 4 Replies

Hi,

You can add a Column to your Datagridview and then select a DatagridviewImageColumn.
In the properties go to Appearance and add an Image

Thank you for reply,
If you can please explain me, how to do this with small example.
(Please don't misunderstand me I am just start learning VB.Net)

        Dim ds As DataSet = New DataSet
        Dim adapter As New OleDb.OleDbDataAdapter
        Dim sql As String = "Select * from E_Info"

        adapter.SelectCommand = New OleDb.OleDbCommand(sql, Con)
        adapter.Fill(ds)
        RTGrid.DataSource = ds.Tables(0)        

These are the code, what I used, It shows ImagePath in Column, But don't want to show file path, I want to show only Image. Please show me,

Perhaps this can help.

Thanks for reply, from that article I learned lot of thing, but I want to another thing, If you can please explain how to do this,

I code like this to load image into datagridview,

Dim NewImage As New DataGridViewImageColumn()
**Dim bmp As Image = Image.FromFile("C:\Users\Public\Pictures\Sample Pictures\Tulips.jpg")**
NewImage.Image = bmp
DataGridView1.Columns.Add(NewImage)
NewImage.HeaderText = "Image"
DataGridView1.DataSource = ds.Tables(0)
NewImage.ImageLayout = DataGridViewImageCellLayout.Zoom

from this show all the data in my Database, with same picture which I speified(I write common path for all). I want to change image path with column(3) text.

I put different Image file paths in Column(3)

Thank you, My English is poor.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.