Hi,
Here is a quick example. Loads the northwind databases category
names into a listbox (listbox1) and displays the image in a picture box
(picturebox1).
Dim ds As DataSet
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim strConn As String
Dim conn As SqlClient.SqlConnection
Dim daCustomer As SqlClient.SqlDataAdapter
ds = New DataSet
' strConn = "Provider = Microsoft.Jet.OLEDB.4.0;"
'strConn &= "Data Source = Northwind.mdb;"
strConn = "Server = " + Environment.MachineName + "\VSdotNet;"
strConn &= "Database = NorthWind;"
strConn &= "Integrated Security = SSPI;"
conn = New SqlClient.SqlConnection(strConn)
daCustomer = New SqlClient.SqlDataAdapter("Select * from Categories", conn)
ds = New DataSet
daCustomer.Fill(ds, "Categories")
ListBox1.DataSource = ds.Tables("Categories")
ListBox1.DisplayMember = "CategoryName"
End Sub
Private Sub ListBox1_SelectedValueChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles ListBox1.SelectedValueChanged
Dim dr As DataRow = ds.Tables("Categories").Rows(ListBox1.SelectedInde x)
Dim ms As New System.IO.MemoryStream
Dim bm As Bitmap
Dim arData() As Byte = dr.Item("Picture")
ms.Write(arData, 78, arData.Length - 78)
bm = New Bitmap(ms)
PictureBox1.Image = bm
End Sub
Ken
-----------------
"Will Gillen" <gi******@nsuok.edu> wrote in message
news:eY**************@TK2MSFTNGP11.phx.gbl...
I have a BLOB (Image) field in SQL Server.
I need to be able to display the image in VB.NET Windows Form.
What documentation/examples are a good place to start research for how to
accomplish this?