dimanche 21 juin 2015

How to insert image in Sqlite with vb.net

I want to insert images in sqlite database, I am using vb.net. In the code below, I am trying to insert 6 same images & 1 text in database. I got a error like this "SQLite error Insufficient parameters supplied to the command". I don't know where I did mistake. So please check and help me ...

Dim imageData As Byte() Dim bitmap As New System.Drawing.Bitmap(lbl_p1.Text) Dim tempMemStream As New IO.MemoryStream bitmap.Save(tempMemStream, System.Drawing.Imaging.ImageFormat.Jpeg) imageData = tempMemStream.ToArray()

Dim qryI As String = "INSERT INTO issuesimages VALUES('" & txt_iq.Text & "',@imageData,@imageData,@imageData,@imageData,@imageData,@imageData)" Dim cmdI As New SQLiteCommand(qryI, con) cmdI.ExecuteNonQuery() cmdI.Dispose()

Aucun commentaire:

Enregistrer un commentaire