I am working on a project where user data is stored in sql db along with its image which is captured using a webcam.
I have finished the part where image is captured successfully and stored in picturebox, but the image from picturebox doesn't pass into the sql table, this part gives an error.
this is my code to insert picturebox image into sql database
Dim cmd As New SqlCommand("INSERT INTO detail4 VALUES(@tag,@pic)", sql)
Dim ms As New MemoryStream()
Dim data As Byte() = ms.GetBuffer()
Dim p As New SqlParameter("@photo", SqlDbType.Image)
p.Value = data
MessageBox.Show("Name & Image has been saved", "Save",MessageBoxButtons.OK)
i get an error at
is it because of rawformat... pls help...