|
-
Oct 13th, 2003, 02:14 PM
#1
Thread Starter
Addicted Member
How to save an imagem, from a PictureBox, to a database? (RESOLVED)
How to save an image, from a PictureBox, to an Access database using OleDb?
How to load an image from this database to a PictureBox?
Thanks.
Last edited by AlvaroF1; Oct 23rd, 2003 at 12:21 PM.
-
Oct 13th, 2003, 03:30 PM
#2
Hyperactive Member
Not an answer but as a pointer start looking at stream,which can both read and write and is the way of moving images around from one place to another in .net
a stream can both read and write and certainly have used them to load images so can see no reason why they can't be used the other way
-
Oct 13th, 2003, 03:30 PM
#3
Hyperactive Member
Not an answer but as a pointer start looking at stream,which can both read and write and is the way of moving images around from one place to another in .net
a stream can both read and write and certainly have used them to load images so can see no reason why they can't be used the other way
-
Oct 13th, 2003, 04:30 PM
#4
This was just asked and answered a week ago and is on the next page of topics. you should try searching before you ask it might save you the time of waiting for an answer.
This example uses SQL I think but will work the same with OLEDB.
http://www.vbforums.com/showthread.p...hreadid=263522
-
Oct 13th, 2003, 08:41 PM
#5
New Member
I think you should try to look at this example.
---------------------------------------------------------
Public Function GetPicture(ByRef LoadedImage As String) As Boolean
On Error GoTo ErrHndlr
With rsEmployee
If IsNull(.Fields("PICT_IMAGE").Value) Then
GetPicture = False
Exit Function
End If
Set strStream = New ADODB.Stream
strStream.Type = adTypeBinary
strStream.Open
strStream.Write .Fields("PICT_IMAGE").Value
strStream.SaveToFile "C:\Temp.bmp", adSaveCreateOverWrite
LoadedImage = "C:\Temp.bmp"
GetPicture = True
End With
End Function
Public Function UpdatePicture(ByVal ImageFilename As String) As Boolean
On Error GoTo ErrHndlr
Dim Image2Save As StdPicture
With rsEmployee
Set strStream = New ADODB.Stream
strStream.Type = adTypeBinary
strStream.Open
strStream.LoadFromFile ImageFilename
.Fields("PICT_IMAGE").Value = strStream.Read
UpdatePicture = True
End With
End Function
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|