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...
-------------------------------------------------------------------------------------
myconn = New MySqlConnection(cons)
mycom = New MySqlCommand
Try
mycom = New MySqlCommand("insert into tblpic values('" & PicID.Text & "','" & PictureBox1.Dock & "')", myconn)
myconn.Open()
mycom.ExecuteNonQuery()
myconn.Close()
MsgBox("Record SAVED")

Catch ex As Exception
MessageBox.Show(ex.Message, "Database Failure!", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try

------------------------------------------------------------------------------------

thanks in advance.(",)

Please use code tags when posting code on daniweb:

[code=vb.net] ...code here...

[/code]

You can't very well insert a picture boxes .Dock state in to the database. You need to use parameters and a byte array. Do a quick google search on "parameterized SQL" and that should get you pointed in the right direction.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.