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
Re: scanner and picture box add to database
What programming language do you use?
Re: scanner and picture box add to database
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?
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 )
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 )