7 Replies - 3620 Views - Last Post: 17 March 2013 - 11:29 AM Rate Topic: -----

#1 nilesh7136  Icon User is offline

  • D.I.C Head

Reputation: 10
  • View blog
  • Posts: 120
  • Joined: 03-January 13

Capture Photo From WebCam In VB.NET 08

Posted 17 March 2013 - 07:06 AM

Hello,,,
I have created a application in vb.net 08, and i have one form for saving details about emp, now i also save photo in database, I am using SQL service based database, any idea how to Upload and Retrive a photo that we haved captured from the webcam.
The question is::
How to Upload photo from the webcam, and store in SQL database?
How to retrieve it to the form to show that on Form??
Please Help Me..


Thankss
@Nilesh

Is This A Good Question/Topic? 0
  • +

Replies To: Capture Photo From WebCam In VB.NET 08

#2 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5464
  • View blog
  • Posts: 11,731
  • Joined: 02-June 10

Re: Capture Photo From WebCam In VB.NET 08

Posted 17 March 2013 - 07:51 AM

http://www.google.co...=UTF-8&oe=UTF-8

You store the photo as a byte[] in the database type of blob.
Was This Post Helpful? 1
  • +
  • -

#3 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9047
  • View blog
  • Posts: 33,955
  • Joined: 12-June 08

Re: Capture Photo From WebCam In VB.NET 08

Posted 17 March 2013 - 08:01 AM

Sure.. storing in a byte array is fine, but I am also a large fan of storing the images in a folder and storing the location (and name) in the database to speed up searching and limit silly sized tables.
Was This Post Helpful? 1
  • +
  • -

#4 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5464
  • View blog
  • Posts: 11,731
  • Joined: 02-June 10

Re: Capture Photo From WebCam In VB.NET 08

Posted 17 March 2013 - 08:17 AM

Agreed. But it can make more coding work. Now you have to make sure the database and the folder stay synchronized. If someone deletes photos from Windows Explorer because they don't know better, the database has to somehow 'know' that. Meaning you're dealing with SystemFolderWatchers etc.

Webcam pictures aren't large, and as a blob keeps everything together for say... An employee record of name, address, ID card photo, fingerprint bitmap for biometric sensor
Was This Post Helpful? 1
  • +
  • -

#5 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9047
  • View blog
  • Posts: 33,955
  • Joined: 12-June 08

Re: Capture Photo From WebCam In VB.NET 08

Posted 17 March 2013 - 08:27 AM

True.. we have something similar at work, but in the code to retrieve the image it checks to make sure it is there first before trying to load it.. a small bit of validation...

On the other hand we have a process that was required we store a 100kb pdf in a blob.. that was dragging ass on our search times so we split the one table into two.. one for all the indexing information we would normally search on and the other with a foreign key to the first table and the blob.. search times came back to normal.
Was This Post Helpful? 2
  • +
  • -

#6 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5464
  • View blog
  • Posts: 11,731
  • Joined: 02-June 10

Re: Capture Photo From WebCam In VB.NET 08

Posted 17 March 2013 - 08:43 AM

We do something similar where the uniqueID of the employee is a GUID, which is then FK to the table with blobs.
Was This Post Helpful? 1
  • +
  • -

#7 nilesh7136  Icon User is offline

  • D.I.C Head

Reputation: 10
  • View blog
  • Posts: 120
  • Joined: 03-January 13

Re: Capture Photo From WebCam In VB.NET 08

Posted 17 March 2013 - 11:03 AM

View Postmodi123_1, on 17 March 2013 - 08:01 AM, said:

Sure.. storing in a byte array is fine, but I am also a large fan of storing the images in a folder and storing the location (and name) in the database to speed up searching and limit silly sized tables.

can you show me some examples, because i don't know anything about that, also no any idea, so Help me..
Was This Post Helpful? 0
  • +
  • -

#8 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9047
  • View blog
  • Posts: 33,955
  • Joined: 12-June 08

Re: Capture Photo From WebCam In VB.NET 08

Posted 17 March 2013 - 11:29 AM

You are capturing the image, right? Generate a unique name.. heck even a sha1 would work.. Write the capture image to a file (filewriter, streamwriter, etc)... use basic SQL insert to write to a table the file name, date inserted, who inserted it, etc... and off you go.
Was This Post Helpful? 2
  • +
  • -

Page 1 of 1