Connecting Tech Pros Worldwide Forums | Help | Site Map

error saving image into mysql database.

Newbie
 
Join Date: Aug 2009
Posts: 1
#1: Aug 26 '09
hey guys need a little help.
i tried to save image into my database, it saves without error
but when i tried to check if it saves in mysql, the data about my picture id save, but the image i save return a value of 0.
please help me with this.

here's my code...
-------------------------------------------------------------------------------------
Expand|Select|Wrap|Line Numbers
  1. myconn = New MySqlConnection(cons)
  2. mycom = New MySqlCommand
  3. Try
  4. mycom = New MySqlCommand("insert into tblpic values('" & PicID.Text & "','" & PictureBox1.Dock & "')", myconn)
  5. myconn.Open()
  6. mycom.ExecuteNonQuery()
  7. myconn.Close()
  8. MsgBox("Record SAVED")
  9.  
  10. Catch ex As Exception
  11. MessageBox.Show(ex.Message, "Database Failure!", MessageBoxButtons.OK, MessageBoxIcon.Error)
  12. End Try
------------------------------------------------------------------------------------

thanks in advance.(",)

tlhintoq's Avatar
Moderator
 
Join Date: Mar 2008
Location: Arizona, USA
Posts: 1,783
#2: Aug 26 '09

re: error saving image into mysql database.


TIP: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a '#' on it. More on tags. They're cool. Check'em out.
Reply


Similar Visual Basic .NET bytes