Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > Pro VB.NET 2002/2003
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Pro VB.NET 2002/2003 For advanced Visual Basic coders working .NET version 2002/2003. Beginning-level questions will be redirected to other forums, including Beginning VB.NET.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB.NET 2002/2003 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
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 3rd, 2007, 06:58 AM
Registered User
Join Date: Feb 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default How To Read And Add Image to Sql 2000 ???

How To Read And Add Image to Sql 2000 ???
By using vb.net 2003 code (not script)


Reply With Quote
  #2 (permalink)  
Old February 5th, 2007, 08:34 AM
Authorized User
Join Date: Nov 2006
Location: , , USA.
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ef1196

Here is the methodology that I used:

1.) The data type for your table should be "IMAGE".
2.) The following code will format your image so it can be saved:
        Dim fs As New FileStream(strFileName, FileMode.Open)
        Dim Data() As Byte = New [Byte](fs.Length) {}
        fs.Read(Data, 0, fs.Length)

        '* Your stored procedure code here...

3.) The following code will format your image so it can be displayed:
        '* Your stored procedure code here...
        '* In this case I used a DataReader

        Dim bits As Byte() = CType(.Item(strFieldName), Byte())
        Dim MemoryBits As New MemoryStream(bits)
        Dim bitmap As New Bitmap(MemoryBits)
        PictureBox1.Image = bitmap

Hope this helps.

Best Regards,
Earl Francis
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
how to insert image in sql 2000 mangala SQL Server 2000 18 December 17th, 2007 06:11 AM
How to Add and Read Image ?? nsr2007nsr VB.NET 2002/2003 Basics 1 February 20th, 2007 08:26 AM
Add records from a DataGridView to SQL Server 2000 VS2005 Visual Basic 2005 Basics 2 November 27th, 2006 08:32 AM
Read SQL Server 2000 files into MS-Access slewis4 SQL Server 2000 8 March 1st, 2006 04:21 PM

All times are GMT -4. The time now is 02:37 PM.

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