Hi All,
I want to store files posted on .aspx web page to a field of GENERAL type in VFP table.
I have no problem reading the posted file to an array of bytes, then creating an OleDbAdapter, creating and populating new DataRow, adding it to a DataTable object and so on:
Dim f As HttpPostedFile = ...
Dim arr(f.ContentLength) As Byte
Dim s As System.IO.Stream = f.InputStream
s.Read(arr, 0, filelen)
...
r("binarydata") = arr
tbl.Rows.Add(r)
...
DBAdapter.Update(dbset, "AnyName")
Here it comes:
Exception Details: System.Data.OleDb.OleDbException: Field BINARYDATA does not accept null values.
What is wrong with my code? I don't really want to go through creating a temporary file and then reading it to a general field.
System.Text.Encoding.UTF8 didn't help either...
Thanks!