473,396 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Picture User Control

Richard Alvarez
Good day guys.. in the days i was busy creating this application that displays and saves an image file within the an access database. the field has an Ole Object property. is there a custom user control for this?


Its a WinForms DTR application. just want to have a quick/easy way of saving and retrieving image files in access database. i know that i have to work it out as a blob but the prob is that i don't know how to do it.

Just hoping if there is a fast way of saving and retrieving images in my access database..

I have one but its in vb6.0 format. how can i convert it to vs .Net?

thanks in advance
Sep 20 '11 #1
11 2024
Frinavale
9,735 Expert Mod 8TB
How are you "displaying" and "saving" the image?

If you just want to store it in a database then connect to and insert/update the image into the database....

Do you know how to use a database in your application?
If you don't then check out this article on how to use a database in your application
Sep 28 '11 #2
Frinavale
9,735 Expert Mod 8TB
I'm still not quite clear on what you're having problems with.
You should be able to connect to the Access Database using an OleDBConnection. You should be able to retrieve data from the database using the OleDBDataReader. Aside from the oledb classes, the article that I posted earlier should outline what you need to do in order to connect to and retrieve data from a database.

-Frinny
Oct 3 '11 #3
about connecting to database; its clear enough with me. the problem is the process of saving and retrieving image files in an ole object.
also i want it to be in this king of format because uniformity in code is what i want to have in my works

Expand|Select|Wrap|Line Numbers
  1. If rsData.State = ConnectionState.Open Then rsData.Close()
  2.         rsData.Open(String.Format("Select * from tblUsers where ID={0}", txtID.Text), DBConn, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockPessimistic)
  3.  
  4. with rsData
  5.      .fields("Pic").value='something binary/blob"
  6.      .update
  7. end with
  8.  
how could i use this format to save and retrieve image files of various formats in access database 2007
Oct 4 '11 #4
by the way rsData in here is declared as ADODB.Recordset and DBConn is declared as ADODB.Connection 'active connection'
Oct 4 '11 #5
Frinavale
9,735 Expert Mod 8TB
You could just try setting the PictureBox.Image with the binary data from the database...

Otherwise you'll have to save the file type so that you can recreate the file.

-Frinny
Oct 4 '11 #6
the user will browse for the image file that is to be inserted in the database.. how would i do that?
Oct 5 '11 #7
Frinavale
9,735 Expert Mod 8TB
Use the OpenFileDialog to let the user choose the file...then open it.
Oct 5 '11 #8
yes of course that would be the one to use but we're already out of what the real problem is. How can I save and retrieve the image file within the ms access database?
Oct 6 '11 #9
Rabbit
12,516 Expert Mod 8TB
You'll need to use the ADODB.Stream object to read and write binary data from/to a database. This link, http://support.microsoft.com/kb/258038, shows an example of how to do that. It's for SQL Server but you should be able to do the same thing with an access database.
Oct 6 '11 #10
this is the thing that really need. Thanks a lot with your help guys. :D thank you so much.
Oct 7 '11 #11
Rabbit
12,516 Expert Mod 8TB
No problem, good luck.
Oct 7 '11 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Ivan D. | last post by:
I am making a User Control in visual basic, it contains a Picture Box. To allow the image to change at design time I added a property. When changing a *normal* PictureBox Image at design time in...
2
by: Tamir Khason | last post by:
I build user control, consists of different things (e.g label, image, etc.) I want to handle click (and other) events, however I can not do it until I do not assign event handler for each control...
3
by: Shailaja Kulkarni | last post by:
hi All, This problem is for C# windows application. I have a user control whcih contains one picture box along with other controls. Depending on certain conditions I want to change images on the...
2
by: memHog | last post by:
I am trying to create a windows application that will perform drag and drop between a usercontrol on a toolbar and a "user document". As the user control is being dragged accross the user...
1
by: DC Gringo | last post by:
Using code-behind, I have a page "index.aspx" that has a user control mainHeader.ascx (with a language selection dropdownlist). Upon selecting a language from the dropdownlist, it should post...
0
by: FredC | last post by:
I'm using VS C#.Net 2003. I built a simple windows form app. with the following attributes: - has a BackgroundImage set to a jpeg I built a very simple user control that contains a picture box set...
1
by: Stan SR | last post by:
Hi, I use a user control within a gridview Something like this <asp:GridView DataSourceID="myDatasource" ID="gvList" runat="server"> <Columns> <asp:TemplateField> <ItemTemplate>...
0
by: phonl | last post by:
VB.net 2005 I have been testing a couple of web camera examples I found on the internet. They use a picture box control for the camera output. I am saving an image captured from the picture...
0
by: Sehboo | last post by:
I am looking for a picture/movie control for asp.net application. I am looking for something similar to which is being used on this page http://elmridge.mem.com/display/biography.asp?ID=1715325. ...
3
by: Spam Catcher | last post by:
Hi all, I'm having some trouble with the Mouse Hover/Leave events on a user control. Say I have a user control with a panel covering the whole control. In turn, a label + picture box cover...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.