In this post you can learned how to Display image in Datagridview using vb.net coding and also you can show all cell of column use the below coding .
Imports System.Data.OleDb
Imports System.Data.SqlClient
Imports System.Data.Sql
Imports System.IO
Imports System.Configuration
Public Class Form1
Sub filterrecords(ByVal sender As String)
Dim connection3 As OleDb.OleDbConnection = New OleDbConnection
connection3.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\\Database16.accdb"
Dim da5 As OleDb.OleDbDataAdapter = New OleDbDataAdapter("SELECT * FROM Table3 ", connection3)
Dim ds5 As New DataSet
Dim dt5 As New DataTable
da5.Fill(dt5)
DataGridView1.DataSource = dt5
Dim imgc As New DataGridViewImageColumn
imgc = DataGridView1.Columns(5)
imgc.ImageLayout = DataGridViewImageCellLayout.Stretch
End Sub
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
filterrecords("")
MsgBox("Saved successfull")
End Sub
Post a Comment