cementboot Posted August 27, 2005 Posted August 27, 2005 Hi, I am trying to figue out the easiest way to store files of any type in a database and then display them in a VB .net application. The concept sounds simple, but I have not been able to find a solution yet. I would be incredibly grateful for any feedback. Quote
Joe Mamma Posted August 29, 2005 Posted August 29, 2005 Hi, I am trying to figue out the easiest way to store files of any type in a database and then display them in a VB .net application. The concept sounds simple, but I have not been able to find a solution yet. I would be incredibly grateful for any feedback. search for saving images to a database, its no different. Quote Joe Mamma Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.
cementboot Posted August 29, 2005 Author Posted August 29, 2005 (edited) search for saving images to a database' date=' its no different.[/quote'] Thanks for your help Joe Mamma. I have attached a project (from planet source code) that I am trying to modify for my needs. It currently loads pictures into a picturebox on the from an Access DB. What I am trying to do is it to load an .rtf file from the Access DB into a richtextbox instead. The code I can't figue out is as follows: Private Sub LoadImage(ByVal recNo As Integer, ByVal dirn As Direction) Dim arr() As Byte Select Case dirn Case Direction.NextImage If recNo <= ds.Tables(0).Rows.Count - 1 Then lblCount.Text = Val(lblCount.Text) + 1 Else Exit Sub End If Case Direction.PreviousImage If recNo > 0 Then lblCount.Text = Val(lblCount.Text) - 1 recNo = recNo - 1 Else Exit Sub End If End Select arr = ds.Tables(0).Rows(recNo).Item(0) [b] '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 'How can I load the OLE object into the RichTextBox instead of a picture box?[/b] [color=Red] picLoad.Image = picLoad.Image.FromStream(New IO.MemoryStream(arr)) [/color][b] '??????????? '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ [/b] 'NOTE: If you want to save the image to a file, you can use the following code: 'FileOpen(1, "filename", OpenMode.Binary) 'FilePut(1, arr) 'FileClose(1) End Sub I would think it would be something like: [color=Red]richtextbox1.text = richtextbox.text.FromStream(New IO.MemoryStream(arr))[/color] But that doesn't seem to work Thanks Again, CementBootDB.zip Edited August 29, 2005 by PlausiblyDamp Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.