Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
.NET 4.5.1 and Visual Studio 2013 General Discussions For discussing anything about .NET 4.5.1, WPF, WCF, the rest of the .NET 4.5.1 Framework, and Visual Studio 2013 that isn't about a specific Wrox book. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET 4.5.1 and Visual Studio 2013 General Discussions section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 27th, 2016, 05:39 PM
Authorized User
Points: 285, Level: 5
Points: 285, Level: 5 Points: 285, Level: 5 Points: 285, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2005
Location: , , .
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Smile Binding A SQL Image Field To A Picture Box

I hope you can help me as I have been searching Google all over to try and get some definitive answers.

I'm using Visual Studio Enterprise 2015, Visual Basic, Windows Forms Applications.

This is what I have so far:

Code:
        Dim dsPODs As DataSet
        Dim daTransport As SqlDataAdapter
        Dim conTransport As New SqlConnection("...")

        Dim PITSGetPODDetail As New SqlCommand()
        PITSGetPODDetail.Connection = conTransport
        PITSGetPODDetail.CommandText = "ssp_PITSGetPODDetail"
        PITSGetPODDetail.CommandType = CommandType.StoredProcedure
        PITSGetPODDetail.Parameters.AddWithValue("@JobNumber", Int16.Parse(JobNumber))

        dsPODs = New DataSet()

        conTransport.Open()
        daTransport = New SqlDataAdapter(PITSGetPODDetail)
        daTransport.Fill(dsPODs, "PODDetail")
        conTransport.Close()

        Dim bytBLOBData() As Byte = dsPODs.Tables(0).Rows(0)("ImageData")
        Dim stmBLOBData As New MemoryStream(bytBLOBData)
        picPODViewer.Image = Image.FromStream(stmBLOBData)
        
        daTransport.Dispose()
        daTransport = Nothing
        dsPODs.Dispose()
        dsPODs = Nothing
The ssp_PITSGetPODDetail stored procedure simply returns any images which matches the Job Number passed to it. The field which is returned is a SQL Image field.

So, the above works to a fashion but needs further work which I am unable to fathom out.

What I would like to happen is a dataset is populated with a number of "images" and then use the Binding Navigator to move the Picture Box through the dataset.

Any help would be greatly appreciated.

Thank you
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Not able to display a Large Image in relatively small picture box RK .NET Framework 1.x 0 January 14th, 2009 05:49 AM
Picture Box proportional to original image. watashi C# 1 April 17th, 2008 02:30 AM
Picture box container controls save to image mujeeb General .NET 0 May 20th, 2006 03:46 AM
How to binding picture file in database ? mojo VB.NET 1 September 7th, 2005 06:49 PM
retriving picture from database(sql) to <asp:image aspnet79434319 Classic ASP Basics 0 June 21st, 2005 01:29 AM



All times are GMT -4. The time now is 04:03 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.