|
-
Dec 8th, 2011, 02:17 AM
#1
Thread Starter
Member
scanner and picture box add to database
Hello,
I have a database with a blob field, I also have a twain activex to scan pictures to add them to the database. I use ado, the problem is when I scan the picture copy it to the picture box but when I press the accept changes button the picture from the picturebox is not inserting, only the data of the text components (text boxes) are inserting in the database.
Any help???
Kyriakos
Last edited by kyriakos70; Dec 8th, 2011 at 02:23 AM.
Reason: more clearer
-
Dec 8th, 2011, 08:28 AM
#2
Re: scanner and picture box add to database
What programming language do you use?
-
Dec 8th, 2011, 10:48 AM
#3
Thread Starter
Member
Re: scanner and picture box add to database
-
Dec 8th, 2011, 03:32 PM
#4
Re: scanner and picture box add to database
What Db are you using? Is the activeX supposed to save pictures to the database or just to the file system?
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
-
Dec 9th, 2011, 02:18 AM
#5
Thread Starter
Member
Re: scanner and picture box add to database
Hello,
I am using sql server 2008, the activex is supposed to save images only to file system but it has a good parameter "save3picturebox" which enables me to scan a picture and then copy the scanned picture to a picturebox which I haveconnected to a database with a dataset in the databindings-image property, the picture is copied but when I press the button to
Code:
Me.BindingContext(DataSet21, "Table_1").EndCurrentEdit()
SqlDataAdapter1.Update(DataSet21, "Table_1")
DataSet21.AcceptChanges()
accept the changes the picturebox clears it self from the picture and in the database are saved only the data from the textboxes, the database has other fields too which are string type and no master detail only one table. Is there any code/other way to insert to the blob field the scanned image?
I am trying this but the code has errors :
Code:
mycommand = New SqlCommand("insert into Table_1([photo]) values (" PictureBox3.Image ")", me.SqlConnection1 )
-
Dec 12th, 2011, 01:51 PM
#6
Re: scanner and picture box add to database
Replace this
Code:
mycommand = New SqlCommand("insert into Table_1([photo]) values (" PictureBox3.Image ")", me.SqlConnection1 )
with this
Code:
mycommand = New SqlCommand("insert into Table_1([photo]) values (" & PictureBox3.Image & ")", me.SqlConnection1 )
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
Tags for this Thread
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
|