By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,784 Members | 1,182 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,784 IT Pros & Developers. It's quick & easy.

error saving image into mysql database.

P: 1
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")
  10. Catch ex As Exception
  11. MessageBox.Show(ex.Message, "Database Failure!", MessageBoxButtons.OK, MessageBoxIcon.Error)
  12. End Try

thanks in advance.(",)
Aug 26 '09 #1
Share this Question
Share on Google+
2 Replies

Expert 2.5K+
P: 3,525
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.
Aug 26 '09 #2

P: 96
you save your images in bit form or string form,
if you are useing string then its very simple,
but if you are using bit form method then its tough
so first tell which method you use to save an image
May 23 '10 #3

Post your reply

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