Chong Posted October 16, 2003 Posted October 16, 2003 I need help with storing images in database. In my mdb file, one of the fields is declared as memo. Back in the vb.net program, I have a box declared as RichTextBox. When I paste an image into this RichTextBox and insert that into the mdb file, there is no error occure....but when I went back to the datagrid to load that entry into the datagrid, I found out that the image wasn't stored. In fact, the variable that holds the RichTextBox with the image shows nothing in between the quotes. So the question I have is, how do I store images with texts in the RichTextBox and store that somehow into a database file? One other concern is, once I am able to store the images into the database file, is the VB.NET datagrid able to show the images when populating the datagrid? I appreciate any help with this problem. ljCharlie Quote
JumpsInLava Posted October 16, 2003 Posted October 16, 2003 I think you need to make the field type an OLE Object. Clicky .....but I would recommend instead saving the file name (text field) in the database, and keeping your images out of the database..... Quote
Chong Posted October 16, 2003 Author Posted October 16, 2003 Thank you very much for the help. I like to the idea of keeping the image out of the database; however, how do I keep the text and the image synchronize when I'm loading them back? ljCharlie Quote
JumpsInLava Posted October 16, 2003 Posted October 16, 2003 I dunno how you are using the images. If it is for something like users or products, then you just have the app request the image with a dialog, save the image to an images location, then write the path & filename to the database. 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.