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))