Imports System.Data.OleDb Imports System.IO Public Class Form1 Dim myConnectionString As String Dim myConnection As OleDbConnection Dim myAdapter As OleDbDataAdapter Dim myDataset As DataSet Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load InitializeComponent() '' Code for Initialize ConnectionString myConnectionString = " Provider=Microsoft.Jet.OLEDB.4.0;Data Source= C:\Users\Bekesoft\Desktop\Programming\Pic Dbase.mdb" myConnection = New OleDbConnection(myConnectionString) Try Catch ex As Exception End Try myConnection.Open() myAdapter = New OleDbDataAdapter("SELECT Photograph FROM Picture", myConnection) myDataset = New DataSet myAdapter.Fill(myDataset) myConnection.Close() Dim myByte() As Byte = CType(myDataset.Tables(0).Rows(0)(0), Byte()) Dim myImage As Image Dim myStream As New MemoryStream(myByte, 0, myByte.Length) myImage = Image.FromStream(myStream) PictureBox1.Image = Image.FromStream(myStream) End Sub End Class
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)