Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Storing HTTP posted file in General field
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Titre:
Storing HTTP posted file in General field
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01025663
Message ID:
01025663
Vues:
58
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!
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform