Picturebox to sql database
Can anybody help me with creating a binary "whatever" from an image (in picturebox or from file don't mind) , then putting that into a mysql database? :S
edit :
i dont mind if its binary or something.. as long as it working :P
:wave:
this is what i have now.....
VB Code:
Dim objStream As Stream = File.Open("c:\handje.gif", FileMode.Open)
Dim buffer(objStream.Length) As Byte
Dim x As String
Con = New ADODB.Connection
Con.Open("driver=MySQL ODBC 3.51 Driver;server=nc2;user=admin;password=sqrl;database=photozone")
objStream.Read(buffer, 0, objStream.Length) : objStream.Close()
x = System.Text.ASCIIEncoding.ASCII.GetString(buffer)
Dim enc As New System.Text.ASCIIEncoding
Con.Execute("INSERT INTO layers (eid,source) VALUES ('1' , '" & x & "')")
/\ it fails at the con.execute.. because of the X value :S