HI,
I am trying to add the contents of an edit field so it is the name of a picture.jpg and then store it in a database.
I want to replace the '1' with the contents of an edit box [edtlocation.text]
Its not compiling and the error i get is
Error description: Length cannot be less than zero.
Parameter name: length
Occurred on line: 142
SQL1.ExecNonQuery("INSERT INTO finds VALUES('" & edtDate.text & "','" & edtTime.text & "','" & edtLat.Text & "','" & edtLong.Text & "','" & edtLocation.Text & "','" & edtDepth.Text & "''" & edtWeight.Text & "''" & edtDetect.Text & "','" & edtCoil.Text & "','"Array As Object(Buffer))")
I am trying to add the contents of an edit field so it is the name of a picture.jpg and then store it in a database.
I want to replace the '1' with the contents of an edit box [edtlocation.text]
B4X:
Dim InputStream1 As InputStream
InputStream1 = File.OpenInput(File.DirRootExternal, "1.jpg") xxxxxxxxxx this is where i want to put the edtLocation.text contents
Dim OutputStream1 As OutputStream
OutputStream1.InitializeToBytesArray(1000)
File.Copy2(InputStream1, OutputStream1)
Dim Buffer() As Byte
Buffer = OutputStream1.ToBytesArray
SQL1.ExecNonQuery("INSERT INTO finds VALUES('" & edtDate.text & "','" & edtTime.text & "','" & edtLat.Text & "','" & edtLong.Text & "','" & edtLocation.Text & "','" & edtDepth.Text & "''" & edtWeight.Text & "''" & edtDetect.Text & "','" & edtCoil.Text & "','"Array As Object(Buffer))")
Its not compiling and the error i get is
Error description: Length cannot be less than zero.
Parameter name: length
Occurred on line: 142
SQL1.ExecNonQuery("INSERT INTO finds VALUES('" & edtDate.text & "','" & edtTime.text & "','" & edtLat.Text & "','" & edtLong.Text & "','" & edtLocation.Text & "','" & edtDepth.Text & "''" & edtWeight.Text & "''" & edtDetect.Text & "','" & edtCoil.Text & "','"Array As Object(Buffer))")
Last edited: