I have a database made up of the table: Clothes made up of about 30 records. Each record contains an image (blob).
I would like to load in the listview only the records that contain the word "Jeans" (under column number 2); inside the listview.
This is the code I use to insert in the database :
I would like to load in the listview only the records that contain the word "Jeans" (under column number 2); inside the listview.
This is the code I use to insert in the database :
B4X:
Private Query As String
'we check if all fields are filled
If edtBrand.Text = "" Or edtPrezzo.Text = "" Then
edtBrand.Text = "Nessuno"
edtPrezzo.Text="Nessuno"
Return
End If
'convert the image file to a bytes array
Dim InputStream1 As InputStream
InputStream1 = File.OpenInput(File.DirRootExternal, "BetaImage.jpg")
Dim OutputStream1 As OutputStream
OutputStream1.InitializeToBytesArray(1000)
File.Copy2(InputStream1, OutputStream1)
Dim Buffer() As Byte
Buffer = OutputStream1.ToBytesArray
Query ="INSERT INTO Clothes VALUES ('" & univoco & " - " & name & "','" & spnCategoria.SelectedItem & "','" & spnColore.SelectedItem & "','" & spnEvento.SelectedItem & "','" & spnStagione.SelectedItem & "','" & spnTaglia.SelectedItem & "','" & edtBrand.Text & "','" & edtPrezzo.Text & "'," & " ?" & ")"
SQL1.ExecNonQuery2(Query,Array As Object (Buffer))